示例#1
0
        public void SetCookieValue_ShouldSetComplexValueWithTimeout()
        {
            var value = new ComplexCookieValue("foo", true, 15);

            _cookieHandler.SetCookieValue("foo", value, DateTime.Now.AddDays(-1));

            var cookie = _cookieHandler.GetCookie("foo");

            Assert.That(cookie.Expires.Date, Is.EqualTo(DateTime.Now.Date.AddDays(-1)));
        }
        public void GetCookieValue_ShouldReturnComplexValue()
        {
            var value = new ComplexCookieValue("foo", true, 15);
            cookieHandler.SetCookieValue("foo", value);

            var result = cookieHandler.GetCookieValue<ComplexCookieValue>("foo");

            Assert.That(result.name, Is.EqualTo("foo"));
            Assert.That(result.valid, Is.EqualTo(true));
            Assert.That(result.length, Is.EqualTo(15));
        }
示例#3
0
        public void SetCookieValue_ShouldSetComplexValue()
        {
            var value = new ComplexCookieValue("foo", true, 15);

            _cookieHandler.SetCookieValue("foo", value);

            var result = _cookieHandler.GetCookieValue <ComplexCookieValue>("foo");

            Assert.That(result.Name, Is.EqualTo("foo"));
            Assert.That(result.Valid, Is.EqualTo(true));
            Assert.That(result.Length, Is.EqualTo(15));
        }
        public void SetCookieValue_ShouldSetComplexValueWithTimeout()
        {
            var value = new ComplexCookieValue("foo", true, 15);
            cookieHandler.SetCookieValue("foo", value, DateTime.Now.AddDays(-1));

            var cookie = cookieHandler.GetCookie("foo");

            Assert.That(cookie.Expires.Date, Is.EqualTo(DateTime.Now.Date.AddDays(-1)));
        }
        public void SetCookieValue_ShouldSetComplexValue()
        {
            var value = new ComplexCookieValue("foo", true, 15);
            _cookieHandler.SetCookieValue("foo", value);

            var result = _cookieHandler.GetCookieValue<ComplexCookieValue>("foo");

            Assert.That(result.Name, Is.EqualTo("foo"));
            Assert.That(result.Valid, Is.EqualTo(true));
            Assert.That(result.Length, Is.EqualTo(15));
        }