public void ShouldExpireCookiesThatAreSetByTheHostIntoThePast() { var value = Guid.NewGuid().ToString(); var client = new HttpPlasmaClient(TestFixture.Application); client.AddCookie(new Cookie("test", value)); var response = client.Get("/Cookies/Expire"); Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); Assert.That(client.GetAllCookies().Any(), Is.False); }
public void ShouldBeAbleToSendCookiesToHost() { var value = Guid.NewGuid().ToString(); var client = new HttpPlasmaClient(TestFixture.Application); client.AddCookie(new Cookie("test", value)); var response = client.Get("/Cookies/Show"); Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); Assert.That(response.GetBody(), Is.StringContaining(value)); }
public void AddCookie(Cookie cookie) { httpClient.AddCookie(new System.Net.Cookie(cookie.Name, cookie.Value)); }