mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-20 16:44:31 +01:00
Add WireMock.Net.TUnit project (#1179)
* Add WireMock.Net.TUnit project * fix * . * fix * bd * 0.1.812 * dotnet test * 0.1.817 * cat * type * type2 * find * -- --diagnostic * --no-build * fix?
This commit is contained in:
37
test/WireMock.Net.TUnitTests/TUnitTests.cs
Normal file
37
test/WireMock.Net.TUnitTests/TUnitTests.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using WireMock.Net.TUnit;
|
||||
using WireMock.RequestBuilders;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Server;
|
||||
using WireMock.Settings;
|
||||
|
||||
namespace WireMock.Net.TUnitTests;
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public class TUnitTests
|
||||
{
|
||||
[Test]
|
||||
public async Task Test_TUnitWireMockLogger()
|
||||
{
|
||||
// Assign
|
||||
var path = $"/foo_{Guid.NewGuid()}";
|
||||
|
||||
using var server = WireMockServer.Start(new WireMockServerSettings
|
||||
{
|
||||
Logger = new TUnitWireMockLogger(TestContext.Current!.GetDefaultLogger())
|
||||
});
|
||||
|
||||
server
|
||||
.Given(Request.Create()
|
||||
.WithPath(path)
|
||||
.UsingGet())
|
||||
.RespondWith(Response.Create().WithBody("TUnit"));
|
||||
|
||||
// Act
|
||||
var response = await server.CreateClient().GetStringAsync($"{server.Url}{path}");
|
||||
|
||||
// Assert
|
||||
await Assert.That(response).IsEqualTo("TUnit");
|
||||
}
|
||||
}
|
||||
18
test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj
Normal file
18
test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj
Normal file
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="TUnit" Version="0.1.817" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\WireMock.Net.TUnit\WireMock.Net.TUnit.csproj" />
|
||||
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user