[Test] public void ByNameAndAttributesControlNS_NamePart() { PureElementNameComparisons(ElementSelectors .ByNameAndAttributesControlNS()); PureElementNameComparisons(ElementSelectors .ByNameAndAttributesControlNS(BAR)); }
[Test] public void ByNameAndAttributesControlNS() { XmlElement control = doc.CreateElement(FOO); control.SetAttribute(BAR, SOME_URI, BAR); XmlElement equal = doc.CreateElement(FOO); equal.SetAttribute(BAR, SOME_URI, BAR); XmlElement noAttributes = doc.CreateElement(FOO); XmlElement differentValue = doc.CreateElement(FOO); differentValue.SetAttribute(BAR, SOME_URI, FOO); XmlElement differentName = doc.CreateElement(FOO); differentName.SetAttribute(FOO, SOME_URI, FOO); XmlElement differentNS = doc.CreateElement(FOO); differentNS.SetAttribute(BAR, SOME_URI + "2", BAR); XmlElement noNS = doc.CreateElement(FOO); noNS.SetAttribute(BAR, BAR); Assert.IsTrue(ElementSelectors.ByNameAndAttributesControlNS(BAR) (control, equal)); Assert.IsFalse(ElementSelectors.ByNameAndAttributesControlNS(BAR) (control, noAttributes)); Assert.IsTrue(ElementSelectors.ByNameAndAttributesControlNS(FOO) (control, noAttributes)); Assert.IsTrue(ElementSelectors.ByNameAndAttributesControlNS() (control, noAttributes)); Assert.IsTrue(ElementSelectors.ByNameAndAttributesControlNS(BAR) (noAttributes, control)); Assert.IsFalse(ElementSelectors.ByNameAndAttributesControlNS(BAR) (noAttributes, noNS)); Assert.IsFalse(ElementSelectors.ByNameAndAttributesControlNS(BAR) (control, differentValue)); Assert.IsFalse(ElementSelectors.ByNameAndAttributesControlNS(BAR) (control, differentName)); Assert.IsFalse(ElementSelectors.ByNameAndAttributesControlNS(BAR) (control, differentNS)); Assert.IsFalse(ElementSelectors.ByNameAndAttributesControlNS(BAR) (control, noNS)); }
public void ByNameAndAttributesControlNSDoesntLikeNullName() { Assert.Throws <ArgumentException>(() => ElementSelectors.ByNameAndAttributesControlNS(new string[] { null })); }
public void ByNameAndAttributesControlNSDoesntLikeNullArgument() { Assert.Throws <ArgumentNullException>(() => ElementSelectors.ByNameAndAttributesControlNS((String[])null)); }