示例#1
0
        public void ValidateAndReturnXmlDocument_ExpectedXml_ShouldReturnXmlDocument(TestXmlParser service)
        {
            var validateAndReturnXmlDocument = service.ValidateAndReturnXmlDocument("<image/>");

            validateAndReturnXmlDocument.Should().NotBeNull();
            validateAndReturnXmlDocument.DocumentElement.Name.Should().Be("image");
        }
示例#2
0
        public void ValidateAndReturnXmlDocument_NotExpectedXml_ShouldThrowException(TestXmlParser service)
        {
            Action a = () => service.ValidateAndReturnXmlDocument("<data/>");

            a.ShouldThrow <ArgumentException>().WithMessage("Xml is not a valid image");
        }
示例#3
0
 public void ValidateAndReturnXmlDocument_EmptyString_ShouldReturnNull(TestXmlParser service)
 {
     service.ValidateAndReturnXmlDocument(string.Empty).Should().BeNull();
 }
示例#4
0
 public void ValidateAndReturnXmlDocument_ExpectedXml_ShouldReturnXmlDocument(TestXmlParser service)
 {
   var validateAndReturnXmlDocument = service.ValidateAndReturnXmlDocument("<image/>");
   validateAndReturnXmlDocument.Should().NotBeNull();
   validateAndReturnXmlDocument.DocumentElement.Name.Should().Be("image");
 }
示例#5
0
 public void ValidateAndReturnXmlDocument_NotExpectedXml_ShouldThrowException(TestXmlParser service)
 {
   Action a = () => service.ValidateAndReturnXmlDocument("<data/>");
   a.ShouldThrow<ArgumentException>().WithMessage("Xml is not a valid image");
 }
示例#6
0
 public void ValidateAndReturnXmlDocument_EmptyString_ShouldReturnNull(TestXmlParser service)
 {
   service.ValidateAndReturnXmlDocument(string.Empty).Should().BeNull();
 }