Example #1
0
        public void TrailingSeparator()
        {
            var subject = new RequestCookieCollection("name=value;");

            subject.Get("name").Value.Should().Be("value");
            subject.Count().Should().Be(1);
        }
Example #2
0
        public void SingleCookie()
        {
            var subject = new RequestCookieCollection("name=value");

            subject.Get("name").Value.Should().Be("value");
            subject.Count().Should().Be(1);
        }
Example #3
0
        public void CommaInValue()
        {
            var subject = new RequestCookieCollection("name=value,value2");

            subject.Get("name").Value.Should().Be("value");
            subject.Get("value2").Value.Should().Be("");
            subject.Count().Should().Be(2);
        }
Example #4
0
        public void TwoCookies()
        {
            var subject = new RequestCookieCollection("name=value;name2=value2");

            subject.Get("name").Value.Should().Be("value");
            subject.Get("name2").Value.Should().Be("value2");
            subject.Count().Should().Be(2);
        }
Example #5
0
        public void CommaSeparated()
        {
            var subject = new RequestCookieCollection("name=value,name2=value2");

            subject.Get("name").Value.ShouldEqual("value");
            subject.Get("name2").Value.ShouldEqual("value2");
            subject.Count().ShouldEqual(2);
        }
Example #6
0
        public void Whitespace()
        {
            var subject = new RequestCookieCollection("name=value\n;\tname2=value2 ; name3=value3\n");

            subject.Get("name").Value.Should().Be("value");
            subject.Get("name2").Value.Should().Be("value2");
            subject.Get("name3").Value.Should().Be("value3");
            subject.Count().Should().Be(3);
        }
Example #7
0
        public void MixedSeparated()
        {
            var subject = new RequestCookieCollection("name=value,name2=value2;name3=value3");

            subject.Get("name").Value.Should().Be("value");
            subject.Get("name2").Value.Should().Be("value2");
            subject.Get("name3").Value.Should().Be("value3");
            subject.Count().Should().Be(3);
        }