public void AttributeDictionary_Indexer_Insert()
        {
            // Arrange
            var attributes = new AttributeDictionary();

            attributes.Add(new KeyValuePair <string, string>("zero", "0"));
            attributes.Add(new KeyValuePair <string, string>("one", "1"));
            attributes.Add(new KeyValuePair <string, string>("two", "2"));

            // Act
            attributes["exciting!"] = "1!";

            // Assert
            Assert.Equal(4, attributes.Count);
            Assert.Collection(
                attributes,
                kvp => Assert.Equal(new KeyValuePair <string, string>("exciting!", "1!"), kvp),
                kvp => Assert.Equal(new KeyValuePair <string, string>("one", "1"), kvp),
                kvp => Assert.Equal(new KeyValuePair <string, string>("two", "2"), kvp),
                kvp => Assert.Equal(new KeyValuePair <string, string>("zero", "0"), kvp));
        }
        public void AttributeDictionary_Remove_KeyValuePair_Failure()
        {
            // Arrange
            var attributes = new AttributeDictionary();

            attributes.Add(new KeyValuePair <string, string>("zero", "0"));
            attributes.Add(new KeyValuePair <string, string>("one", "1"));
            attributes.Add(new KeyValuePair <string, string>("two", "2"));

            // Act
            var result = attributes.Remove(new KeyValuePair <string, string>("one", "0"));

            // Assert
            Assert.False(result);
            Assert.Equal(3, attributes.Count);
            Assert.Collection(
                attributes,
                kvp => Assert.Equal(new KeyValuePair <string, string>("one", "1"), kvp),
                kvp => Assert.Equal(new KeyValuePair <string, string>("two", "2"), kvp),
                kvp => Assert.Equal(new KeyValuePair <string, string>("zero", "0"), kvp));
        }
        public void AttributeDictionary_CopyTo()
        {
            // Arrange
            var attributes = new AttributeDictionary();

            attributes.Add(new KeyValuePair <string, string>("zero", "0"));
            attributes.Add(new KeyValuePair <string, string>("one", "1"));
            attributes.Add(new KeyValuePair <string, string>("two", "2"));

            var array = new KeyValuePair <string, string> [attributes.Count + 1];

            // Act
            attributes.CopyTo(array, 1);

            // Assert
            Assert.Collection(
                array,
                kvp => Assert.Equal(default(KeyValuePair <string, string>), kvp),
                kvp => Assert.Equal(new KeyValuePair <string, string>("one", "1"), kvp),
                kvp => Assert.Equal(new KeyValuePair <string, string>("two", "2"), kvp),
                kvp => Assert.Equal(new KeyValuePair <string, string>("zero", "0"), kvp));
        }