File tree Expand file tree Collapse file tree 3 files changed +30
-4
lines changed
src/QAToolKit.Engine.Bombardier.Test Expand file tree Collapse file tree 3 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 2727 - name : Install dependencies
2828 run : dotnet restore
2929 - name : Build
30- run : dotnet build --configuration Release --no-restore
30+ run : dotnet build --configuration Release
3131 - name : Test
3232 run : dotnet test --no-restore --verbosity normal
3333 - name : Upload a Build Artifact
Original file line number Diff line number Diff line change @@ -767,5 +767,31 @@ public async Task GenerateBombardierTestRateLimitNumberOfRequestTest_Fails()
767767
768768 await Assert . ThrowsAsync < QAToolKitBombardierException > ( async ( ) => await bombardierTestsGenerator . Generate ( ) ) ;
769769 }
770+
771+ [ Fact ]
772+ public async Task GenerateBombardierTestGeneratorCreationTest_Success ( )
773+ {
774+ var content = File . ReadAllText ( "Assets/getPetById.json" ) ;
775+ var httpRequest = JsonConvert . DeserializeObject < IEnumerable < HttpRequest > > ( content ) ;
776+
777+ var bombardierTestsGenerator = new BombardierTestsGenerator ( httpRequest ) ;
778+
779+ var bombardierTests = await bombardierTestsGenerator . Generate ( ) ;
780+
781+ Assert . NotNull ( bombardierTests ) ;
782+ Assert . Single ( bombardierTests ) ;
783+ Assert . Contains ( " -m GET https://petstore3.swagger.io/api/v3/pet/10 -c 3 --http2 --timeout=30s --duration=10s" , bombardierTests . FirstOrDefault ( ) . Command ) ;
784+ Assert . Equal ( HttpMethod . Get , bombardierTests . FirstOrDefault ( ) . Method ) ;
785+ Assert . Equal ( "https://petstore3.swagger.io/api/v3/pet/10" , bombardierTests . FirstOrDefault ( ) . Url . ToString ( ) ) ;
786+ }
787+
788+ [ Fact ]
789+ public void GenerateBombardierTestGeneratorCreationTest_Fails ( )
790+ {
791+ var content = File . ReadAllText ( "Assets/getPetById.json" ) ;
792+ var httpRequest = JsonConvert . DeserializeObject < IEnumerable < HttpRequest > > ( content ) ;
793+
794+ Assert . Throws < ArgumentNullException > ( ( ) => new BombardierTestsGenerator ( null ) ) ;
795+ }
770796 }
771797}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public BombardierTestsRunnerTests(ITestOutputHelper testOutputHelper)
2222 _logger = loggerFactory . CreateLogger < BombardierTestsRunnerTests > ( ) ;
2323 }
2424
25- // [IgnoreOnGithubFact]
25+ [ IgnoreOnGithubFact ]
2626 public async Task BombardierGetTestWithOptionsTest_Successfull ( )
2727 {
2828 var content = File . ReadAllText ( "Assets/getPetById.json" ) ;
@@ -65,7 +65,7 @@ public async Task BombardierGetTestWithOptionsTest_Successfull()
6565 Assert . True ( bombardierResults . FirstOrDefault ( ) . TestStop . Subtract ( bombardierResults . FirstOrDefault ( ) . TestStart ) . TotalSeconds == bombardierResults . FirstOrDefault ( ) . Duration ) ;
6666 }
6767
68- // [IgnoreOnGithubFact]
68+ [ IgnoreOnGithubFact ]
6969 public async Task BombardierPostTestWithOptionsTest_Successfull ( )
7070 {
7171 var content = File . ReadAllText ( "Assets/addPet.json" ) ;
@@ -113,7 +113,7 @@ public async Task BombardierPostTestWithOptionsTest_Successfull()
113113 Assert . True ( bombardierResults . FirstOrDefault ( ) . TestStop . Subtract ( bombardierResults . FirstOrDefault ( ) . TestStart ) . TotalSeconds == bombardierResults . FirstOrDefault ( ) . Duration ) ;
114114 }
115115
116- // [IgnoreOnGithubFact]
116+ [ IgnoreOnGithubFact ]
117117 public async Task BombardierPostTestWithBodyAndOptionsTest_Successfull ( )
118118 {
119119 var content = File . ReadAllText ( "Assets/AddBike.json" ) ;
You can’t perform that action at this time.
0 commit comments