mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-24 18:11:10 +01:00
Pin the version from Testcontainers to 3.7.0 in WireMock.Net.Testcontainers (#1057)
* TestcontainersTests * WireMockContainer_Build_and_StartAsync_and_StopAsync * -- * [3.7.0]
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using FluentAssertions.Execution;
|
||||
using WireMock.Net.Testcontainers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Testcontainers;
|
||||
|
||||
public class TestcontainersTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task WireMockContainer_Build_and_StartAsync_and_StopAsync()
|
||||
{
|
||||
// Act
|
||||
var wireMockContainer = new WireMockContainerBuilder()
|
||||
.WithAutoRemove(true)
|
||||
.WithCleanUp(true)
|
||||
.Build();
|
||||
|
||||
try
|
||||
{
|
||||
await wireMockContainer.StartAsync().ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
using (new AssertionScope())
|
||||
{
|
||||
var url = wireMockContainer.GetPublicUrl();
|
||||
url.Should().NotBeNullOrWhiteSpace();
|
||||
|
||||
var adminClient = wireMockContainer.CreateWireMockAdminClient();
|
||||
|
||||
var settings = await adminClient.GetSettingsAsync();
|
||||
settings.Should().NotBeNull();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
await wireMockContainer.StopAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -105,6 +105,10 @@
|
||||
<PackageReference Include="JsonConverter.System.Text.Json" Version="0.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'">
|
||||
<ProjectReference Include="..\..\src\WireMock.Net.Testcontainers\WireMock.Net.Testcontainers.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="OpenApiParser\*.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
||||
Reference in New Issue
Block a user