mirror of https://github.com/winsw/winsw
update ServiceDescriptor.cs
parent
e8518e8b11
commit
53e66038a1
|
@ -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();
|
||||||
|
|
|
@ -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>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue