Closed neoistheone123 closed 8 years ago
IHttpServer serverA = null;
serverA = HttpMockRepository.At("http://localhost:10100");
serverA.Stub(x => x.Get("/PingList")).WithUrlConstraint(u => u.Contains("date=1-2")).Return("1").OK();
serverA.Stub(x => x.Get("/PingList")).WithUrlConstraint(u => u.Contains("date=1-2-3")).Return("2").OK();
var client = new RestClient("http://localhost:10100");
var request = new RestRequest("PingList", Method.GET);
request.AddQueryParameter("date", "1-2");
var resp = client.Execute(request);
resp.Content.Should().Contain("1");
request = new RestRequest("PingList", Method.GET);
request.AddQueryParameter("date", "1-2-3");
resp = client.Execute(request);
resp.Content.Should().Contain("2");
serverA.Dispose();
Result Message: Expected string "1" to contain "2".
Result Message: Expected string "1" to contain "2".