public void Expect(Response response) { using (var client = new HttpClient()) { var result = client.SendAsync(_lastRequest).Result; _lastResponse = new Response(); _lastResponse.FillFromHttpResponse(result); } CheckResponse(response, _lastResponse); }
private void CheckResponse(Response expected, Response actual) { Assert.AreEqual(expected.StatusCode, actual.StatusCode, "Status code mismatched"); Assert.IsTrue(expected.ResponseCheckerFunction == null || expected.ResponseCheckerFunction(actual), "Custom condition function failed"); }