Skip to content

Commit e3d90e5

Browse files
authored
updates
1 parent 6668883 commit e3d90e5

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

.github/workflows/dotnet-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
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

src/QAToolKit.Engine.Bombardier.Test/BombardierTestsGeneratorTests.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

src/QAToolKit.Engine.Bombardier.Test/BombardierTestsRunnerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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");

0 commit comments

Comments
 (0)