mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-16 15:16:53 +01:00
37 lines
839 B
C#
37 lines
839 B
C#
using System.IO;
|
|
using log4net.Config;
|
|
using WireMock.FluentAssertions;
|
|
using WireMock.RequestBuilders;
|
|
using WireMock.ResponseBuilders;
|
|
using WireMock.Server;
|
|
|
|
namespace WireMock.Net.ConsoleApplication;
|
|
|
|
static class Program
|
|
{
|
|
static void Main(params string[] args)
|
|
{
|
|
XmlConfigurator.Configure(new FileInfo("log4net.config"));
|
|
|
|
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();
|
|
}
|
|
} |