public void XMLValidationCorrectXml() { var currentDirectory = Directory.GetCurrentDirectory(); var correctImportFilepath = $"{currentDirectory}\\xml\\CorrectInput.xml"; var correctXDocument = XElement.Load(correctImportFilepath); var xmlValidatedResult = xmlValidation.XmlValidate(correctXDocument); Assert.AreEqual(true, xmlValidatedResult.IsSuccess); Assert.IsNull(xmlValidatedResult.ErrorMessage); }
public (string XmlValid, string DeclarationCommand, string SiteId) XmlValidationOperation(XElement xElement, InputDocument checkConstraints) { var validation = xmlValidation.XmlValidate(xElement); var validationResult = validation.IsSuccess == true ? "0" : validation.ErrorMessage; var declarationCommand = xmlParse.GetAttribute(xElement); var declarationCommandResult = declarationCommand.Attribute == checkConstraints.Command ? "0" : "-1"; var site = xmlParse.GetElement(xElement); var siteResult = site.Element == checkConstraints.SiteId ? "0" : "-2"; return(validationResult, declarationCommandResult, siteResult); }