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:
Stef Heyenrath
2024-09-25 08:52:40 +02:00
committed by GitHub
parent 836976ca19
commit b892e85d2a
8 changed files with 198 additions and 8 deletions

View 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");
}
}

View 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>