This commit is contained in:
Stef Heyenrath
2023-05-13 09:34:57 +02:00
parent 6ef116a295
commit 9f1a15a917
5 changed files with 133 additions and 49 deletions

View File

@@ -1,5 +1,9 @@
using System.IO;
using log4net.Config;
using WireMock.FluentAssertions;
using WireMock.RequestBuilders;
using WireMock.ResponseBuilders;
using WireMock.Server;
namespace WireMock.Net.ConsoleApplication;
@@ -9,6 +13,25 @@ static class Program
{
XmlConfigurator.Configure(new FileInfo("log4net.config"));
MainApp.Run();
var server = WireMockServer.Start();
server
.Given(Request.Create()
.WithPath("todos")
.UsingGet()
)
.RespondWith(Response.Create()
.WithBody("test")
);
server
.Should()
.HaveReceivedACall()
.AtAbsoluteUrl("some-url").And
.WithHeader("header-name", "header-value");
server.Stop();
// MainApp.Run();
}
}