Esempio n. 1
0
        public void FromNVC()
        {
            // Arrange
            var nvc = new NameValueCollection { { "a", "1" }, { "b", "2" } };

            // Act
            var collection = new Elfar.Collection{ nvc };

            // Arrange
            Assert.That(collection, Is.Not.Null);
            Assert.That(collection["a"], Is.EqualTo("1"));
            Assert.That(collection["b"], Is.EqualTo("2"));
        }
Esempio n. 2
0
        public void FromString()
        {
            // Arrange
            const string s = @"{""a"":""1"",""b"":""2""}";

            // Act
            Elfar.Collection collection = s;

            // Arrange
            Assert.That(collection, Is.Not.Null);
            Assert.That(collection["a"], Is.EqualTo("1"));
            Assert.That(collection["b"], Is.EqualTo("2"));
        }
Esempio n. 3
0
        public new void ToString()
        {
            // Arrange
            var collection = new Elfar.Collection
            {
                { "a", "1" },
                { "b", "2" }
            };

            // Act
            var s = collection.ToString();

            // Assert
            Assert.That(s, Is.EqualTo(@"{""a"":""1"",""b"":""2""}"));
        }
Esempio n. 4
0
        public new void ToString()
        {
            // Arrange
            var collection = new Elfar.Collection
            {
                { "a", "1" },
                { "b", "2" }
            };

            // Act
            var s = collection.ToString();

            // Assert
            Assert.That(s, Is.EqualTo(@"{""a"":""1"",""b"":""2""}"));
        }
Esempio n. 5
0
        public void FromCookies()
        {
            // Arrange
            var cookies = new HttpCookieCollection
            {
                    new HttpCookie("a", "1"),
                    new HttpCookie("b", "2")
            };

            // Act
            var collection = new Elfar.Collection{ cookies };

            // Arrange
            Assert.That(collection, Is.Not.Null);
            Assert.That(collection["a"], Is.EqualTo("1"));
            Assert.That(collection["b"], Is.EqualTo("2"));
        }
Esempio n. 6
0
        public void FromNVC()
        {
            // Arrange
            var nvc = new NameValueCollection {
                { "a", "1" }, { "b", "2" }
            };

            // Act
            var collection = new Elfar.Collection {
                nvc
            };

            // Arrange
            Assert.That(collection, Is.Not.Null);
            Assert.That(collection["a"], Is.EqualTo("1"));
            Assert.That(collection["b"], Is.EqualTo("2"));
        }
Esempio n. 7
0
        public void FromCookies()
        {
            // Arrange
            var cookies = new HttpCookieCollection
            {
                new HttpCookie("a", "1"),
                new HttpCookie("b", "2")
            };

            // Act
            var collection = new Elfar.Collection {
                cookies
            };

            // Arrange
            Assert.That(collection, Is.Not.Null);
            Assert.That(collection["a"], Is.EqualTo("1"));
            Assert.That(collection["b"], Is.EqualTo("2"));
        }