public void ShouldAccessStaticInstance() { // Act IXsdValidator xsdValidator = XsdValidator.Instance; // Assert Assert.That(xsdValidator, Is.Not.Null); }
public void ShouldAccessStaticInstance() { // Act IXsdValidator xsdValidator = XsdValidator.Current; // Assert xsdValidator.Should().NotBeNull(); }
public void ShouldValidateXsdSchemaSuccessfully() { // Arrange string xmlContent = XmlTestData.GetValidXmlContent(); string xsdContent = XmlTestData.GetXsdMarkup(); IXsdValidator xsdValidator = XsdValidator.Instance; // Act var validationResult = xsdValidator.Validate(xmlContent, xsdContent); // Assert Assert.That(validationResult.IsValid, Is.True); }
public void ShouldFailToValidateXsdSchema() { // Arrange string xmlContent = XmlTestData.GetInvalidXmlContent(); string xsdContent = XmlTestData.GetXsdMarkup(); IXsdValidator xsdValidator = XsdValidator.Instance; // Act var validationResult = xsdValidator.Validate(xmlContent, xsdContent); // Assert Assert.That(validationResult.IsValid, Is.False); Assert.That(validationResult.Errors, Has.Count.EqualTo(1)); // var meg = validationResult.Errors.ElementAt(0).Message; }