mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-01 15:13:33 +02:00
fix unit-test
This commit is contained in:
@@ -156,18 +156,19 @@ namespace WireMock.Net.Tests
|
|||||||
.RespondWith(Response.Create()
|
.RespondWith(Response.Create()
|
||||||
.WithBody("Test state msg 2"));
|
.WithBody("Test state msg 2"));
|
||||||
|
|
||||||
// when
|
// when / then
|
||||||
string url = "http://localhost:" + _server.Ports[0];
|
string url = "http://localhost:" + _server.Ports[0];
|
||||||
var responseNoState1 = await new HttpClient().GetStringAsync(url + "/state1");
|
var http = new HttpClient();
|
||||||
var responseNoState2 = await new HttpClient().GetStringAsync(url + "/state2");
|
var responseNoState1 = await http.GetStringAsync(url + "/state1");
|
||||||
|
|
||||||
var responseWithState1 = await new HttpClient().GetStringAsync(url + "/foo");
|
|
||||||
var responseWithState2 = await new HttpClient().GetStringAsync(url + "/foo");
|
|
||||||
|
|
||||||
// then
|
|
||||||
Check.That(responseNoState1).Equals("No state msg 1");
|
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");
|
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");
|
Check.That(responseWithState2).Equals("Test state msg 2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user