Esempio n. 1
0
        public void ConditionalReturnsFalseIfConditionIsNotMet()
        {
            XmlElement control = doc.CreateElement(FOO);
            XmlElement test    = doc.CreateElement(FOO);

            Assert.IsFalse(ElementSelectors.ConditionalSelector(o => false,
                                                                ElementSelectors.ByName)
                               (control, test));
        }
Esempio n. 2
0
        public void ConditionalAsksWrappedSelectorIfConditionIsMet()
        {
            XmlElement control = doc.CreateElement(FOO);
            XmlElement test    = doc.CreateElement(BAR);
            XmlElement test2   = doc.CreateElement(FOO);

            Assert.IsFalse(ElementSelectors.ConditionalSelector(o => true,
                                                                ElementSelectors.ByName)
                               (control, test));
            Assert.IsTrue(ElementSelectors.ConditionalSelector(o => true,
                                                               ElementSelectors.ByName)
                              (control, test2));
        }
Esempio n. 3
0
 public void ConditionalSelectorDoesntLikeNullPredicate()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           ElementSelectors.ConditionalSelector(null, ElementSelectors.ByName));
 }
Esempio n. 4
0
 public void ConditionalSelectorDoesntLikeNullElementSelector()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           ElementSelectors.ConditionalSelector(x => x != null, null));
 }