public void IsValidXmlRule_Check_StringInvalidXml_ReturnsNoError()
 {
     //------------Setup for test--------------------------
     var rule = new IsValidXmlRule(() => "<x><d>any data</d></x>");
     rule.LabelText = "Xml";
     //------------Execute Test---------------------------
     var errorInfo = rule.Check();
     //------------Assert Results-------------------------
     Assert.IsNull(errorInfo);
 }
 public void IsValidXmlRule_Check_StringIsInvalidXml_ReturnsError()
 {
     //------------Setup for test--------------------------
     var rule = new IsValidXmlRule(() => "<x><s>");
     rule.LabelText = "Xml";
     //------------Execute Test---------------------------
     var errorInfo = rule.Check();
     //------------Assert Results-------------------------
     Assert.IsNotNull(errorInfo);
     Assert.AreEqual("Xml is not a valid expression", errorInfo.Message);
 }
Пример #3
0
        public void IsValidXmlRule_Check_StringInvalidXml_ReturnsNoError()
        {
            //------------Setup for test--------------------------
            var rule = new IsValidXmlRule(() => "<x><d>any data</d></x>");

            rule.LabelText = "Xml";
            //------------Execute Test---------------------------
            var errorInfo = rule.Check();

            //------------Assert Results-------------------------
            Assert.IsNull(errorInfo);
        }
Пример #4
0
        public void IsValidXmlRule_Check_StringIsInvalidXml_ReturnsError()
        {
            //------------Setup for test--------------------------
            var rule = new IsValidXmlRule(() => "<x><s>");

            rule.LabelText = "Xml";
            //------------Execute Test---------------------------
            var errorInfo = rule.Check();

            //------------Assert Results-------------------------
            Assert.IsNotNull(errorInfo);
            Assert.AreEqual("Xml is not a valid expression", errorInfo.Message);
        }