[Test] public void ByNameAndAttributes_NamePart() { PureElementNameComparisons(ElementSelectors .ByNameAndAttributes(new string[] {})); PureElementNameComparisons(ElementSelectors .ByNameAndAttributes(new XmlQualifiedName[] {})); PureElementNameComparisons(ElementSelectors.ByNameAndAttributes(BAR)); PureElementNameComparisons(ElementSelectors .ByNameAndAttributes(new XmlQualifiedName(BAR, SOME_URI))); }
[Test] public void byNameAndAttributes_QName() { XmlElement control = doc.CreateElement(FOO); control.SetAttribute(BAR, BAR); XmlElement equal = doc.CreateElement(FOO); equal.SetAttribute(BAR, BAR); XmlElement noAttributes = doc.CreateElement(FOO); XmlElement differentValue = doc.CreateElement(FOO); differentValue.SetAttribute(BAR, FOO); XmlElement differentName = doc.CreateElement(FOO); differentName.SetAttribute(FOO, FOO); XmlElement differentNS = doc.CreateElement(FOO); differentNS.SetAttribute(BAR, SOME_URI, BAR); Assert.IsTrue(ElementSelectors.ByNameAndAttributes(new XmlQualifiedName(BAR)) (control, equal)); Assert.IsFalse(ElementSelectors.ByNameAndAttributes(new XmlQualifiedName(BAR)) (control, noAttributes)); Assert.IsTrue(ElementSelectors.ByNameAndAttributes(new XmlQualifiedName(FOO)) (control, noAttributes)); Assert.IsTrue(ElementSelectors.ByNameAndAttributes(new XmlQualifiedName[] {}) (control, noAttributes)); Assert.IsFalse(ElementSelectors.ByNameAndAttributes(new XmlQualifiedName(BAR)) (noAttributes, control)); Assert.IsFalse(ElementSelectors.ByNameAndAttributes(new XmlQualifiedName(BAR)) (control, differentValue)); Assert.IsFalse(ElementSelectors.ByNameAndAttributes(new XmlQualifiedName(BAR)) (control, differentName)); Assert.IsFalse(ElementSelectors.ByNameAndAttributes(new XmlQualifiedName(BAR)) (control, differentNS)); }
public void ByNameAndAttributesDoesntLikeNullNameXmlQualifiedNameVersion() { Assert.Throws <ArgumentException>(() => ElementSelectors.ByNameAndAttributes(new XmlQualifiedName[] { null })); }
public void ByNameAndAttributesDoesntLikeNullNameStringVersion() { Assert.Throws <ArgumentException>(() => ElementSelectors.ByNameAndAttributes(new string[] { null })); }
public void ByNameAndAttributesDoesntLikeNullArgumentXmlQualifiedNameVersion() { Assert.Throws <ArgumentNullException>(() => ElementSelectors.ByNameAndAttributes((XmlQualifiedName[])null)); }
public void ByNameAndAttributesDoesntLikeNullArgumentStringVersion() { Assert.Throws <ArgumentNullException>(() => ElementSelectors.ByNameAndAttributes((string[])null)); }