示例#1
0
        public void TestValidateAlgorithm_NoName_NoThrow()
        {
            TestVisitor     v       = new TestVisitor();
            JobXmlValidator visitor = new JobXmlValidator(v);

            XNode xml = new XElement("algorithm");

            visitor.VisitAlgorithm(xml);
            Assert.IsFalse(v.VisitedAlgorithm);
        }
示例#2
0
        public void TestValidateAlgorithm_PropertyNoType_NoThrow()
        {
            TestVisitor     v       = new TestVisitor();
            JobXmlValidator visitor = new JobXmlValidator(v);

            XNode xml = new XElement("algorithm", new XAttribute("name", "gamma"),
                                     new XElement("properties",
                                                  new XElement("property",
                                                               new XAttribute("name", "gamma"),
                                                               new XAttribute("value", "1"))));

            visitor.VisitAlgorithm(xml);
            Assert.IsFalse(v.VisitedAlgorithm);
        }
示例#3
0
        public void TestValidateAlgorithm_InvalidXml()
        {
            TestVisitor     v       = new TestVisitor();
            JobXmlValidator visitor = new JobXmlValidator(v);

            visitor.ThrowOnError = true;

            XNode xml = new XElement("algorithm", new XAttribute("name", "gamma"),
                                     new XElement("properties",
                                                  new XElement("property",
                                                               new XAttribute("name", "gamma"),
                                                               new XAttribute("type", "notatype"))));

            visitor.VisitAlgorithm(xml);
        }
示例#4
0
        public void TestValidateAlgorithm_ValidXml()
        {
            TestVisitor     v       = new TestVisitor();
            JobXmlValidator visitor = new JobXmlValidator(v);

            XNode xml = new XElement("algorithm", new XAttribute("name", "gamma"),
                                     new XElement("properties",
                                                  new XElement("property",
                                                               new XAttribute("name", "gamma"),
                                                               new XAttribute("type", typeof(double)),
                                                               new XAttribute("value", "1"))));

            visitor.VisitAlgorithm(xml);
            Assert.IsTrue(v.VisitedAlgorithm);
        }
示例#5
0
 public void TestConstructor_ValidArgs()
 {
     TestVisitor     v       = new TestVisitor();
     JobXmlValidator visitor = new JobXmlValidator(v);
 }
示例#6
0
 public void TestConstructor_NullArgs()
 {
     JobXmlValidator v = new JobXmlValidator(null);
 }