Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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");
 }