From cacfd4e1e86292bb48f77d0c221c4bbf12be712e Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Thu, 23 Nov 2017 07:52:07 +0100 Subject: [PATCH] Updated Using WireMock in UnitTests (markdown) --- Using-WireMock-in-UnitTests.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Using-WireMock-in-UnitTests.md b/Using-WireMock-in-UnitTests.md index 8573540..20f9e9e 100644 --- a/Using-WireMock-in-UnitTests.md +++ b/Using-WireMock-in-UnitTests.md @@ -4,7 +4,7 @@ Obviously you can use your favourite test framework and use WireMock within your - clean up the request log or shutdown the server at the end of each test Below a simple example using Nunit and NFluent test assertion library: -```csharp +```cs [SetUp] public void StartMockServer() { @@ -18,7 +18,7 @@ public async void Should_respond_to_request() _sut = new SomeComponentDoingHttpCalls(); _server - .Given(Request.Create().WithUrl("/foo").UsingGet()) + .Given(Request.Create().WithPath("/foo").UsingGet()) .RespondWith( Response.Create() .WithStatusCode(200) @@ -30,9 +30,6 @@ public async void Should_respond_to_request() // then Check.That(response).IsEqualTo(EXPECTED_RESULT); - - // and optionally - Check.That(_server.FindLogEntries(Request.WithUrl("/error*")).IsEmpty(); } [TearDown]