コード例 #1
0
        public void CustomHttpHeadersCollection_Count_ReturnsZeroAfterLastItemRemoved()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop       = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Remove(prop);
            Assert.AreEqual(0, properties.Count);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }
コード例 #4
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);
        }
コード例 #5
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);
        }
コード例 #6
0
        public void CustomHttpHeadersCollection_Remove_NullThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Remove((CustomHttpHeader)null);
        }
コード例 #7
0
        public void CustomHttpHeadersCollection_Remove_EmptyKeyThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Remove(String.Empty);
        }
コード例 #8
0
        public void CustomHttpHeadersCollection_Count_ReturnsZeroAfterLastItemRemoved()
        {
            var properties = new CustomHttpHeadersCollection();
            var prop = new CustomHttpHeader("TestHeader", "Test Value");

            properties.Remove(prop);
            Assert.AreEqual(0, properties.Count);
        }
コード例 #9
0
        public void CustomHttpHeadersCollection_Remove_EmptyKeyThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Remove(String.Empty);
        }
コード例 #10
0
        public void CustomHttpHeadersCollection_Remove_NullKeyThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Remove((string)null);
        }