public void TestRemovingAttribute() { AttributeCollection attributes = new AttributeCollection(); attributes.Add("Test1", new AttributeValue("Test Value1")); attributes.Add("Test2", new AttributeValue("Test Value2")); attributes.Add("Test3", new AttributeValue("Test Value3")); attributes.Add("Test4", new AttributeValue("Test Value4")); Assert.IsTrue(attributes.ContainsAttribute("Test3")); Assert.IsTrue(attributes.Remove("Test3")); Assert.IsFalse(attributes.ContainsAttribute("Test3")); }
public void TestSuccessfullCheckIfAttributeExists() { AttributeCollection attributes = new AttributeCollection(); AttributeValue newAttributeValue = new AttributeValue("Test Value"); // Add the attribute attributes.Add("Test", newAttributeValue); Assert.IsTrue(attributes.ContainsAttribute("Test")); }
public void TestFailedCheckIfAttributeExists() { AttributeCollection attributes = new AttributeCollection(); Assert.IsFalse(attributes.ContainsAttribute("Not Found")); }