@@ -12,10 +12,10 @@ public class Program
12
12
13
13
public static void Main ( string [ ] args )
14
14
{
15
- // By default we assume we're being run in the context of the <repo>/src/Http/Http.Results/src
15
+ // By default we assume we're being run in the context of the <repo>/src/Http/Http.Results/tools/ResultsOfTGenerator directory
16
16
var pwd = Directory . GetCurrentDirectory ( ) ;
17
- var classTargetFilePath = Path . Combine ( pwd , "ResultsOfT.Generated.cs" ) ;
18
- var testsTargetFilePath = Path . Combine ( pwd , ".." , "test" , "ResultsOfTTests.Generated.cs" ) ;
17
+ var classTargetFilePath = Path . Combine ( pwd , ".." , ".." , "src" , " ResultsOfT.Generated.cs") ;
18
+ var testsTargetFilePath = Path . Combine ( pwd , ".." , ".." , " test", "ResultsOfTTests.Generated.cs" ) ;
19
19
20
20
if ( args . Length > 0 )
21
21
{
@@ -482,7 +482,7 @@ static void GenerateTest_ExecuteResult_ExecutesAssignedResult(StreamWriter write
482
482
static void GenerateTest_Throws_ArgumentNullException_WhenHttpContextIsNull ( StreamWriter writer , int typeArgNumber )
483
483
{
484
484
//[Fact]
485
- //public void ResultsOfTResult1TResult2_Throws_ArgumentNullException_WhenHttpContextIsNull()
485
+ //public async Task ResultsOfTResult1TResult2_Throws_ArgumentNullException_WhenHttpContextIsNull()
486
486
//{
487
487
// // Arrange
488
488
// Results<ChecksumResult1, NoContent> MyApi()
@@ -494,7 +494,7 @@ static void GenerateTest_Throws_ArgumentNullException_WhenHttpContextIsNull(Stre
494
494
// // Act & Assert
495
495
// var result = MyApi();
496
496
497
- // Assert.ThrowsAsync<ArgumentNullException>(async () =>
497
+ // await Assert.ThrowsAsync<ArgumentNullException>(async () =>
498
498
// {
499
499
// await result.ExecuteAsync(httpContext);
500
500
// });
@@ -504,7 +504,7 @@ static void GenerateTest_Throws_ArgumentNullException_WhenHttpContextIsNull(Stre
504
504
writer . WriteIndentedLine ( "[Fact]" ) ;
505
505
506
506
// Start method
507
- writer . WriteIndent ( 1 , "public void ResultsOf" ) ;
507
+ writer . WriteIndent ( 1 , "public async Task ResultsOf" ) ;
508
508
for ( int j = 1 ; j <= typeArgNumber ; j ++ )
509
509
{
510
510
writer . Write ( $ "TResult{ j } ") ;
@@ -526,7 +526,7 @@ static void GenerateTest_Throws_ArgumentNullException_WhenHttpContextIsNull(Stre
526
526
writer . WriteIndentedLine ( 2 , "var result = MyApi();" ) ;
527
527
writer . WriteLine ( ) ;
528
528
529
- writer . WriteIndentedLine ( 2 , "Assert.ThrowsAsync<ArgumentNullException>(async () =>" ) ;
529
+ writer . WriteIndentedLine ( 2 , "await Assert.ThrowsAsync<ArgumentNullException>(async () =>" ) ;
530
530
writer . WriteIndentedLine ( 2 , "{" ) ;
531
531
writer . WriteIndentedLine ( 3 , "await result.ExecuteAsync(httpContext);" ) ;
532
532
writer . WriteIndentedLine ( 2 , "});" ) ;
@@ -539,7 +539,7 @@ static void GenerateTest_Throws_ArgumentNullException_WhenHttpContextIsNull(Stre
539
539
static void GenerateTest_Throws_InvalidOperationException_WhenResultIsNull ( StreamWriter writer , int typeArgNumber )
540
540
{
541
541
//[Fact]
542
- //public void ResultsOfTResult1TResult2_Throws_InvalidOperationException_WhenResultIsNull()
542
+ //public async Task ResultsOfTResult1TResult2_Throws_InvalidOperationException_WhenResultIsNull()
543
543
//{
544
544
// // Arrange
545
545
// Results<ChecksumResult1, NoContent> MyApi()
@@ -551,7 +551,7 @@ static void GenerateTest_Throws_InvalidOperationException_WhenResultIsNull(Strea
551
551
// // Act & Assert
552
552
// var result = MyApi();
553
553
554
- // Assert.ThrowsAsync<InvalidOperationException>(async () =>
554
+ // await Assert.ThrowsAsync<InvalidOperationException>(async () =>
555
555
// {
556
556
// await result.ExecuteAsync(httpContext);
557
557
// });
@@ -561,7 +561,7 @@ static void GenerateTest_Throws_InvalidOperationException_WhenResultIsNull(Strea
561
561
writer . WriteIndentedLine ( "[Fact]" ) ;
562
562
563
563
// Start method
564
- writer . WriteIndent ( 1 , "public void ResultsOf" ) ;
564
+ writer . WriteIndent ( 1 , "public async Task ResultsOf" ) ;
565
565
for ( int j = 1 ; j <= typeArgNumber ; j ++ )
566
566
{
567
567
writer . Write ( $ "TResult{ j } ") ;
@@ -583,7 +583,7 @@ static void GenerateTest_Throws_InvalidOperationException_WhenResultIsNull(Strea
583
583
writer . WriteIndentedLine ( 2 , "var result = MyApi();" ) ;
584
584
writer . WriteLine ( ) ;
585
585
586
- writer . WriteIndentedLine ( 2 , "Assert.ThrowsAsync<InvalidOperationException>(async () =>" ) ;
586
+ writer . WriteIndentedLine ( 2 , "await Assert.ThrowsAsync<InvalidOperationException>(async () =>" ) ;
587
587
writer . WriteIndentedLine ( 2 , "{" ) ;
588
588
writer . WriteIndentedLine ( 3 , "await result.ExecuteAsync(httpContext);" ) ;
589
589
writer . WriteIndentedLine ( 2 , "});" ) ;
0 commit comments