Beispiel #1
0
        public async Task ShouldReturnCorrectContent(string absolute, string relative, Type typeOfResponse)
        {
            var application = new Application(new Uri(absolute, UriKind.Absolute));
            var request     = new HttpRequest(relative);
            var requester   = new HttpRequester();

            var response = await requester.MakeRequest(request, application);

            Assert.That(response.Body, Is.TypeOf(typeOfResponse));
        }
Beispiel #2
0
        public async Task ShouldReturnOk(string absolute, string relative, HttpStatusCode expectedStatus)
        {
            var application = new Application(new Uri(absolute, UriKind.Absolute));
            var request     = new HttpRequest(relative)
            {
                Session = new CookieRetainingSession()
            };
            var requester = new HttpRequester();

            var response = await requester.MakeRequest(request, application);

            Assert.That(response.StatusCode, Is.EqualTo(expectedStatus));
        }