public void op_Verify_CookieContainer_whenWrongStatus() { var cookies = new CookieContainer(); var expectation = new HttpExpectation { Exchange = new HttpExchange { Request = new HttpRequest { Line = new HttpRequestLine("GET", "http://www.alan-dean.com/") }, Response = new HttpResponse { Line = new HttpStatusLine(HttpStatusCode.OK) } } }; Assert.Throws <HttpTestException>(() => expectation.Verify(cookies)); }
public void op_Verify_CookieContainer() { var cookies = new CookieContainer(); var expectation = new HttpExpectation { Exchange = new HttpExchange { Request = new HttpRequest { Line = new HttpRequestLine("GET", "http://www.alan-dean.com/") }, Response = new HttpResponse { Line = new HttpStatusLine(HttpStatusCode.SeeOther), Headers = new HttpHeaderDictionary { new HttpHeader("Location", "http://www.alan-dean.com/about") } } } }; Assert.True(expectation.Verify(cookies)); }
public void op_Verify_CookieContainer_whenWrongLocation() { var cookies = new CookieContainer(); var expectation = new HttpExpectation { Exchange = new HttpExchange { Request = new HttpRequest { Line = new HttpRequestLine("GET", "http://www.alan-dean.com/") }, Response = new HttpResponse { Line = new HttpStatusLine(HttpStatusCode.SeeOther), Headers = new HttpHeaderDictionary { new HttpHeader("Location", "http://www.alan-dean.com/example") } } } }; Assert.Throws <HttpTestException>(() => expectation.Verify(cookies)); }
public void op_Verify_CookieContainer_whenWrongStatus() { var cookies = new CookieContainer(); var expectation = new HttpExpectation { Exchange = new HttpExchange { Request = new HttpRequest { Line = new HttpRequestLine("GET", "http://www.alan-dean.com/") }, Response = new HttpResponse { Line = new HttpStatusLine(HttpStatusCode.OK) } } }; Assert.Throws<HttpTestException>(() => expectation.Verify(cookies)); }
public void op_Verify_CookieContainer_whenWrongLocation() { var cookies = new CookieContainer(); var expectation = new HttpExpectation { Exchange = new HttpExchange { Request = new HttpRequest { Line = new HttpRequestLine("GET", "http://www.alan-dean.com/") }, Response = new HttpResponse { Line = new HttpStatusLine(HttpStatusCode.SeeOther), Headers = new HttpHeaderDictionary { new HttpHeader("Location", "http://www.alan-dean.com/example") } } } }; Assert.Throws<HttpTestException>(() => expectation.Verify(cookies)); }