Ejemplo n.º 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);
        }
Ejemplo n.º 2
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]);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 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"));
        }
Ejemplo n.º 6
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"]);
        }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
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));
        }
Ejemplo n.º 10
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());
        }
Ejemplo n.º 11
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);
        }
Ejemplo n.º 12
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());
        }
Ejemplo n.º 13
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]);
        }
Ejemplo n.º 14
0
 public void CustomHttpHeadersCollection_CapacityConstructor_SucceedsWithZeroValue()
 {
     var properties = new CustomHttpHeadersCollection(0);
 }
Ejemplo n.º 15
0
 public void CustomHttpHeadersCollection_CapacityConstructor_SucceedsWithZeroValue()
 {
     var properties = new CustomHttpHeadersCollection(0);
 }
Ejemplo n.º 16
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);
        }
Ejemplo n.º 17
0
 public void CustomHttpHeadersCollection_CapacityConstructor_FailsWithNegativeValue()
 {
     var properties = new CustomHttpHeadersCollection(-1);
 }
Ejemplo n.º 18
0
 public void CustomHttpHeadersCollection_Contains_NullNameThrows()
 {
     var properties = new CustomHttpHeadersCollection();
     properties.Contains((string)null);
 }
Ejemplo n.º 19
0
        public void CustomHttpHeadersCollection_Remove_EmptyKeyThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Remove(String.Empty);
        }
Ejemplo n.º 20
0
        public void CustomHttpHeadersCollection_Remove_NullKeyThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Remove((string)null);
        }
Ejemplo n.º 21
0
        public void CustomHttpHeadersCollection_Remove_EmptyKeyThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Remove(String.Empty);
        }
Ejemplo n.º 22
0
        public void CustomHttpHeadersCollection_Add_NullThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Add(null);
        }
Ejemplo n.º 23
0
 public void CustomHttpHeadersCollection_CapacityConstructor_FailsWithNegativeValue()
 {
     var properties = new CustomHttpHeadersCollection(-1);
 }
Ejemplo n.º 24
0
 public void CustomHttpHeadersCollection_CapacityConstructor_Succeeds()
 {
     var properties = new CustomHttpHeadersCollection(10);
 }
Ejemplo n.º 25
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"]);
        }
Ejemplo n.º 26
0
        public void CustomHttpHeadersCollection_Contains_NullPropertyThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Contains((CustomHttpHeader)null);
        }
Ejemplo n.º 27
0
        public void CustomHttpHeadersCollection_Add_NullThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Add(null);
        }
Ejemplo n.º 28
0
        public void CustomHttpHeadersCollection_Contains_EmptyNameThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Contains(String.Empty);
        }
Ejemplo n.º 29
0
        public void CustomHttpHeadersCollection_Remove_NullThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Remove((CustomHttpHeader)null);
        }
Ejemplo n.º 30
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);
        }
Ejemplo n.º 31
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);
        }
Ejemplo n.º 32
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);
        }
Ejemplo n.º 33
0
 public void CustomHttpHeadersCollection_CapacityConstructor_Succeeds()
 {
     var properties = new CustomHttpHeadersCollection(10);
 }
Ejemplo n.º 34
0
        public void CustomHttpHeadersCollection_Count_ReturnsZeroForNewCollection()
        {
            var properties = new CustomHttpHeadersCollection();

            Assert.AreEqual(0, properties.Count);
        }
Ejemplo n.º 35
0
 public void CustomHttpHeadersCollection_Contains_EmptyNameThrows()
 {
     var properties = new CustomHttpHeadersCollection();
     properties.Contains(String.Empty);
 }
Ejemplo n.º 36
0
        public void CustomHttpHeadersCollection_Count_ReturnsZeroForNewCollection()
        {
            var properties = new CustomHttpHeadersCollection();

            Assert.AreEqual(0, properties.Count);
        }
Ejemplo n.º 37
0
 public void CustomHttpHeadersCollection_Contains_NullPropertyThrows()
 {
     var properties = new CustomHttpHeadersCollection();
     properties.Contains((CustomHttpHeader)null);
 }
Ejemplo n.º 38
0
        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));
        }
Ejemplo n.º 39
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"));
        }
Ejemplo n.º 40
0
        public void CustomHttpHeadersCollection_Contains_NullNameThrows()
        {
            var properties = new CustomHttpHeadersCollection();

            properties.Contains((string)null);
        }