Skip to content

Commit

Permalink
case-sensitive filename in Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
zijianhuang committed Jun 10, 2024
1 parent 38f9f59 commit 07a5f41
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 65 deletions.
128 changes: 64 additions & 64 deletions Tests/SwagApiTestsTextJson/PetsIntegration.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using Fonlow.Net.Http;
using Fonlow.Testing;
using My.Pet.Client;
using System;
using System.Threading.Tasks;
using Xunit;

namespace IntegrationTests
{
public class PetsFixture : BasicHttpClient
{
public PetsFixture()
{
var c = TestingSettings.Instance.ServiceCommands[0];
HttpClient.BaseAddress = new System.Uri(c.BaseUrl);

using Fonlow.Net.Http;
using Fonlow.Testing;
using My.Pet.Client;
using System;
using System.Threading.Tasks;
using Xunit;

namespace IntegrationTests
{
public class PetsFixture : BasicHttpClient
{
public PetsFixture()
{
var c = TestingSettings.Instance.ServiceCommands[0];
HttpClient.BaseAddress = new System.Uri(c.BaseUrl);

Api = new PetClient(HttpClient, new System.Text.Json.JsonSerializerOptions()
{
DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault,
Expand All @@ -24,55 +24,55 @@ public PetsFixture()
public PetClient Api { get; private set; }
}

[Collection(TestConstants.LaunchWebApiAndInit)]
public partial class PetsApiIntegration : IClassFixture<PetsFixture>
{
public PetsApiIntegration(PetsFixture fixture)
{
api = fixture.Api;
}

readonly PetClient api;

[Fact]
public async Task TestFindPets()
{
Pet[] aa = await api.FindPetsByStatusAsync(PetStatus.sold);
Assert.Equal(3, aa.Length);
}

[Fact]
public async Task TestGetPet()
{
Pet d = await api.GetPetByIdAsync(12);
Assert.Equal("Narco", d.Name);
}

[Fact]
public async Task TestAddPet()
{
await api.AddPetAsync(new Pet()
[Collection(TestConstants.LaunchWebApiAndInit)]
public partial class PetsApiIntegration : IClassFixture<PetsFixture>
{
public PetsApiIntegration(PetsFixture fixture)
{
api = fixture.Api;
}

readonly PetClient api;

[Fact]
public async Task TestFindPets()
{
Pet[] aa = await api.FindPetsByStatusAsync(PetStatus.sold);
Assert.Equal(3, aa.Length);
}

[Fact]
public async Task TestGetPet()
{
Pet d = await api.GetPetByIdAsync(12);
Assert.Equal("Narco", d.Name);
}

[Fact]
public async Task TestAddPet()
{
await api.AddPetAsync(new Pet()
{
//Id=339,
Name = "KKK", //required
PhotoUrls = new string[] { "http://somewhere.com/mydog.jpg" }, //required,
Tags = new Tag[] { //not required. However, when presented, it must contain at least one item.
new Tag()
{
//Id=3,
Name="Hey"
}
},
});
}


[Fact]
public async Task TestPetsDelete()
{
WebApiRequestException ex = await Assert.ThrowsAsync<WebApiRequestException>(() => api.DeletePetAsync(9));
Assert.Equal("NoSuchPet", ex.Response);
}

}
}
Tags = new Tag[] { //not required. However, when presented, it must contain at least one item.
new Tag()
{
//Id=3,
Name="Hey"
}
},
});
}


[Fact]
public async Task TestPetsDelete()
{
WebApiRequestException ex = await Assert.ThrowsAsync<WebApiRequestException>(() => api.DeletePetAsync(9));
Assert.Equal("NoSuchPet", ex.Response);
}

}
}
2 changes: 1 addition & 1 deletion Tests/SwagTests/CodeGenCsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void TestPetDelete()
[Fact]
public void TestPetTypes()
{
GenerateAndAssertAndBuild("SwagMock/PetTypes.json", "Results/PetTypes.txt");
GenerateAndAssertAndBuild("SwagMock/petTypes.json", "Results/PetTypes.txt");
}

[Fact]
Expand Down

0 comments on commit 07a5f41

Please sign in to comment.