public void Items_will_remove_item_by_name_when_element_is_removed() { var doc = new DomDocument(); var index = doc.CreateAttributeTokenIndex("class"); var a = doc.AppendElement("root").AppendElement("a").Attribute("class", "a"); Assume.NotEmpty(index); a.RemoveSelf(); Assert.Empty(index); }
public void Items_will_remove_item_by_name_when_class_is_removed() { var doc = new DomDocument(); var index = doc.CreateAttributeTokenIndex("class"); var a = doc.AppendElement("root").AppendElement("a").Attribute("class", "a b"); Assume.NotEmpty(index); a.RemoveClass("a"); Assert.SetEqual(new [] { a }, index["b"]); }