Exemple #1
0
 [Test] public void ByNameAndAttributesControlNS_NamePart()
 {
     PureElementNameComparisons(ElementSelectors
                                .ByNameAndAttributesControlNS());
     PureElementNameComparisons(ElementSelectors
                                .ByNameAndAttributesControlNS(BAR));
 }
Exemple #2
0
        [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));
        }
Exemple #3
0
 public void ByNameAndAttributesControlNSDoesntLikeNullName()
 {
     Assert.Throws <ArgumentException>(() =>
                                       ElementSelectors.ByNameAndAttributesControlNS(new string[] { null }));
 }
Exemple #4
0
 public void ByNameAndAttributesControlNSDoesntLikeNullArgument()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           ElementSelectors.ByNameAndAttributesControlNS((String[])null));
 }