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); }
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); }
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); }
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); }
public void TestConstructor_ValidArgs() { TestVisitor v = new TestVisitor(); JobXmlValidator visitor = new JobXmlValidator(v); }
public void TestConstructor_NullArgs() { JobXmlValidator v = new JobXmlValidator(null); }