public void TestLoadSchema() { using ( TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml) ) { XmlHelper.LoadSchema(tempFile); } }
public void TestThrowOnSyntaxErrorSchema() { using ( TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml) ) { Assert.Throws <XmlSchemaException>(delegate() { XmlHelper.LoadSchema(tempFile); }); } }
public void TestThrowOnInvalidSchema() { using ( TempFileKeeper tempFile = new TempFileKeeper(brokenSchemaXml) ) { Assert.Throws <XmlException>(delegate() { XmlHelper.LoadSchema(tempFile); }); } }
public void TestTryLoadSchema() { using ( TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml) ) { XmlSchema schema; Assert.IsTrue(XmlHelper.TryLoadSchema(tempFile, out schema)); Assert.NotNull(schema); } }
public void TestFailOnTryLoadSyntaxErrorSchema() { using ( TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml) ) { XmlSchema schema; Assert.IsFalse(XmlHelper.TryLoadSchema(tempFile, out schema)); Assert.IsNull(schema); } }
public void TestFailOnLoadNonConformingDocument() { using (TextReader schemaReader = new StringReader(pointsSchemaXml)) { XmlSchema schema = XmlHelper.LoadSchema(schemaReader); using ( TempFileKeeper tempFile = new TempFileKeeper(unconformantXml) ) { Assert.Throws <XmlSchemaValidationException>( delegate() { XmlHelper.LoadDocument(schema, tempFile); } ); } } }
public void TestFailOnLoadInvalidDocument() { using (TextReader schemaReader = new StringReader(pointsSchemaXml)) { XmlSchema schema = XmlHelper.LoadSchema(schemaReader); using ( TempFileKeeper tempFile = new TempFileKeeper(brokenXml) ) { Assert.Throws <XmlException>( delegate() { XmlHelper.LoadDocument(schema, tempFile); } ); } } }
public void TestLoadConformingDocument() { using (TextReader schemaReader = new StringReader(pointsSchemaXml)) { XmlSchema schema = XmlHelper.LoadSchema(schemaReader); using ( TempFileKeeper tempFile = new TempFileKeeper(conformantXml) ) { #if USE_XMLDOCUMENT XmlDocument document = XmlHelper.LoadDocument(schema, tempFile); #else XDocument document = XmlHelper.LoadDocument(schema, tempFile); #endif } } }
public void TestLoadConformingDocument() { using(TextReader schemaReader = new StringReader(pointsSchemaXml)) { XmlSchema schema = XmlHelper.LoadSchema(schemaReader); using( TempFileKeeper tempFile = new TempFileKeeper(conformantXml) ) { #if USE_XMLDOCUMENT XmlDocument document = XmlHelper.LoadDocument(schema, tempFile); #else XDocument document = XmlHelper.LoadDocument(schema, tempFile); #endif } } }
public void TestFailOnLoadNonConformingDocument() { using(TextReader schemaReader = new StringReader(pointsSchemaXml)) { XmlSchema schema = XmlHelper.LoadSchema(schemaReader); using( TempFileKeeper tempFile = new TempFileKeeper(unconformantXml) ) { Assert.Throws<XmlSchemaValidationException>( delegate() { XmlHelper.LoadDocument(schema, tempFile); } ); } } }
public void TestFailOnLoadInvalidDocument() { using(TextReader schemaReader = new StringReader(pointsSchemaXml)) { XmlSchema schema = XmlHelper.LoadSchema(schemaReader); using( TempFileKeeper tempFile = new TempFileKeeper(brokenXml) ) { Assert.Throws<XmlException>( delegate() { XmlHelper.LoadDocument(schema, tempFile); } ); } } }
public void TestTryLoadSchema() { using( TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml) ) { XmlSchema schema; Assert.IsTrue(XmlHelper.TryLoadSchema(tempFile, out schema)); Assert.NotNull(schema); } }
public void TestLoadSchema() { using( TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml) ) { XmlHelper.LoadSchema(tempFile); } }
public void TestFailOnTryLoadSyntaxErrorSchema() { using( TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml) ) { XmlSchema schema; Assert.IsFalse(XmlHelper.TryLoadSchema(tempFile, out schema)); Assert.IsNull(schema); } }
public void TestThrowOnSyntaxErrorSchema() { using( TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml) ) { Assert.Throws<XmlSchemaException>(delegate() { XmlHelper.LoadSchema(tempFile); }); } }
public void TestThrowOnInvalidSchema() { using( TempFileKeeper tempFile = new TempFileKeeper(brokenSchemaXml) ) { Assert.Throws<XmlException>(delegate() { XmlHelper.LoadSchema(tempFile); }); } }