コード例 #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)));
        }
コード例 #2
0
        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));
        }
コード例 #4
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)));
        }
コード例 #5
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));
        }