Example #1
0
        public void CustomHttpHeadersCollection_Contains_ReturnsTrueForExistingItem()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop       = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);

            Assert.AreEqual(true, properties.Contains(prop));
        }
Example #2
0
        public void CustomHttpHeadersCollection_Indexer_ThrowsOnUnknownKey()
        {
            var properties = new CustomHttpHeadersCollection();
            var p          = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(p);

            Assert.AreEqual(p, properties["NotAValidKey"]);
        }
Example #3
0
        public void CustomHttpHeadersCollection_Count_ReturnsOneAfterItemAdded()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop       = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);

            Assert.AreEqual(1, properties.Count);
        }
Example #4
0
        public void CustomHttpHeadersCollection_Indexer_Succeeds()
        {
            var properties = new CustomHttpHeadersCollection();
            var p          = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(p);

            Assert.AreEqual(p, properties[p.Name]);
        }
Example #5
0
        public void CustomHttpHeadersCollection_Contains_ReturnsFalseForNonExistentKey()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop       = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);

            Assert.AreEqual(false, properties.Contains("NotAValidKey"));
        }
Example #6
0
        public void CustomHttpHeadersCollection_Remove_RemoveInstanceSucceeds()
        {
            var properties = new CustomHttpHeadersCollection();
            var p          = new CustomHttpHeader("TestProp1", "Test Value");

            properties.Add(p);

            Assert.AreEqual(true, properties.Remove(p));
            Assert.AreEqual(0, properties.Count);
        }
Example #7
0
        public void CustomHttpHeadersCollection_Contains_ReturnsFalseForExistingKeyDifferentItem()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop       = new CustomHttpHeader("TestHeader", "Test Value");

            var prop2 = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);

            Assert.AreEqual(false, properties.Contains(prop2));
        }
        public void CustomHttpHeadersCollection_Contains_ReturnsFalseForExistingKeyDifferentItem()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop = new CustomHttpHeader("TestHeader", "Test Value");

            var prop2 = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);

            Assert.AreEqual(false, properties.Contains(prop2));
        }
Example #9
0
        public void CustomHttpHeadersCollection_GetEnumerator_Success()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop       = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);
            var enumerator = ((IEnumerable)properties).GetEnumerator();

            Assert.AreEqual(true, enumerator.MoveNext());
            Assert.AreEqual(prop, enumerator.Current);
            Assert.AreEqual(false, enumerator.MoveNext());
        }
Example #10
0
        public void CustomHttpHeadersCollection_Remove_RemoveInstanceForDifferentInstanceWithSameKeyReturnsFalse()
        {
            var properties = new CustomHttpHeadersCollection();
            var p          = new CustomHttpHeader("TestProp1", "Test Value");

            var p2 = new CustomHttpHeader("TestProp1", "Test Value");

            properties.Add(p);

            Assert.AreEqual(false, properties.Remove(p2));
            Assert.AreEqual(1, properties.Count);
        }
        public void CustomHttpHeadersCollection_Remove_RemoveInstanceSucceeds()
        {
            var properties = new CustomHttpHeadersCollection();
            var p = new CustomHttpHeader("TestProp1", "Test Value");

            properties.Add(p);

            Assert.AreEqual(true, properties.Remove(p));
            Assert.AreEqual(0, properties.Count);
        }
        public void CustomHttpHeadersCollection_Add_NullThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Add(null);
        }
        public void CustomHttpHeadersCollection_Remove_RemoveInstanceForDifferentInstanceWithSameKeyReturnsFalse()
        {
            var properties = new CustomHttpHeadersCollection();
            var p = new CustomHttpHeader("TestProp1", "Test Value");

            var p2 = new CustomHttpHeader("TestProp1", "Test Value");

            properties.Add(p);

            Assert.AreEqual(false, properties.Remove(p2));
            Assert.AreEqual(1, properties.Count);
        }
        public void CustomHttpHeadersCollection_Indexer_ThrowsOnUnknownKey()
        {
            var properties = new CustomHttpHeadersCollection();
            var p = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(p);

            Assert.AreEqual(p, properties["NotAValidKey"]);
        }
        public void CustomHttpHeadersCollection_Indexer_Succeeds()
        {
            var properties = new CustomHttpHeadersCollection();
            var p = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(p);

            Assert.AreEqual(p, properties[p.Name]);
        }
        public void CustomHttpHeadersCollection_GetEnumerator_Success()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);
            var enumerator = ((IEnumerable)properties).GetEnumerator();

            Assert.AreEqual(true, enumerator.MoveNext());
            Assert.AreEqual(prop, enumerator.Current);
            Assert.AreEqual(false, enumerator.MoveNext());
        }
        public void CustomHttpHeadersCollection_Count_ReturnsOneAfterItemAdded()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);

            Assert.AreEqual(1, properties.Count);
        }
Example #18
0
        public void CustomHttpHeadersCollection_Add_NullThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Add(null);
        }
        public void CustomHttpHeadersCollection_Contains_ReturnsFalseForNonExistentKey()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);

            Assert.AreEqual(false, properties.Contains("NotAValidKey"));
        }
        public void CustomHttpHeadersCollection_Contains_ReturnsTrueForExistingKey()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Add(prop);

            Assert.AreEqual(true, properties.Contains(prop.Name));
        }