update ServiceDescriptor.cs

pull/460/merge^2
Buddhika Chathuranga 2020-05-30 02:39:07 +05:30
parent e8518e8b11
commit 53e66038a1
2 changed files with 4 additions and 4 deletions

View File

@ -71,7 +71,7 @@ namespace winsw
{ {
using(var reader = new StreamReader(BasePath + ".xml")) using(var reader = new StreamReader(BasePath + ".xml"))
{ {
dom = ServiceDescriptor.XmlValidation(reader); dom = ServiceDescriptor.ValidateXMLSchema(reader);
} }
} }
catch (XmlException e) catch (XmlException e)
@ -109,11 +109,11 @@ namespace winsw
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static ServiceDescriptor FromXML(string xml) public static ServiceDescriptor FromXML(string xml)
{ {
return new ServiceDescriptor(XmlValidation(new StringReader(xml))); return new ServiceDescriptor(ValidateXMLSchema(new StringReader(xml)));
} }
public static XmlDocument XmlValidation(TextReader textReader) public static XmlDocument ValidateXMLSchema(TextReader textReader)
{ {
XmlReaderSettings settings = new XmlReaderSettings(); XmlReaderSettings settings = new XmlReaderSettings();
Assembly a = Assembly.GetExecutingAssembly(); Assembly a = Assembly.GetExecutingAssembly();

View File

@ -456,7 +456,7 @@ $@"<service>
</id> </id>
"; ";
Assert.That(() => ServiceDescriptor.XmlValidation(new StringReader(seedXml)), Throws.Exception.TypeOf<XmlException>()); Assert.That(() => ServiceDescriptor.ValidateXMLSchema(new StringReader(seedXml)), Throws.Exception.TypeOf<XmlException>());
} }
} }
} }