Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 public void AddCookie(Cookie cookie)
 {
     httpClient.AddCookie(new System.Net.Cookie(cookie.Name, cookie.Value));
 }