fix unit-test

This commit is contained in:
Stef Heyenrath
2018-02-14 20:38:19 +01:00
parent 4f87146622
commit 1ffd56701c

View File

@@ -156,18 +156,19 @@ namespace WireMock.Net.Tests
.RespondWith(Response.Create()
.WithBody("Test state msg 2"));
// when
// when / then
string url = "http://localhost:" + _server.Ports[0];
var responseNoState1 = await new HttpClient().GetStringAsync(url + "/state1");
var responseNoState2 = await new HttpClient().GetStringAsync(url + "/state2");
var responseWithState1 = await new HttpClient().GetStringAsync(url + "/foo");
var responseWithState2 = await new HttpClient().GetStringAsync(url + "/foo");
// then
var http = new HttpClient();
var responseNoState1 = await http.GetStringAsync(url + "/state1");
Check.That(responseNoState1).Equals("No state msg 1");
Check.That(responseWithState1).Equals("Test state msg 1");
var responseNoState2 = await http.GetStringAsync(url + "/state2");
Check.That(responseNoState2).Equals("No state msg 2");
var responseWithState1 = await http.GetStringAsync(url + "/foo");
Check.That(responseWithState1).Equals("Test state msg 1");
var responseWithState2 = await http.GetStringAsync(url + "/foo");
Check.That(responseWithState2).Equals("Test state msg 2");
}