public void AddChild(IsNotDefinedFilter filter) { if (child != null) throw new InvalidFilterException("only one child allowed"); child = filter; }
public void AddChild(IsNotDefinedFilter filter) { if (children.Any()) throw new InvalidFilterException("IsNotDefinedFilter cannot have siblings"); children.Add(filter); }
public void TestIsNotDefinedFilter() { var uut = new IsNotDefinedFilter(); var xmlDoc = new XmlDocument(); xmlDoc.LoadXml(AddNamespace(uut.ToXml())); Assert.AreEqual(1, xmlDoc.GetElementsByTagName("C:is-not-defined").Count); }