Exemplo n.º 1
0
 public void TestLoadSchema()
 {
     using (
         TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml)
         ) {
         XmlHelper.LoadSchema(tempFile);
     }
 }
Exemplo n.º 2
0
 public void TestThrowOnSyntaxErrorSchema()
 {
     using (
         TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml)
         ) {
         Assert.Throws <XmlSchemaException>(delegate() { XmlHelper.LoadSchema(tempFile); });
     }
 }
Exemplo n.º 3
0
 public void TestThrowOnInvalidSchema()
 {
     using (
         TempFileKeeper tempFile = new TempFileKeeper(brokenSchemaXml)
         ) {
         Assert.Throws <XmlException>(delegate() { XmlHelper.LoadSchema(tempFile); });
     }
 }
Exemplo n.º 4
0
 public void TestTryLoadSchema()
 {
     using (
         TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml)
         ) {
         XmlSchema schema;
         Assert.IsTrue(XmlHelper.TryLoadSchema(tempFile, out schema));
         Assert.NotNull(schema);
     }
 }
Exemplo n.º 5
0
 public void TestFailOnTryLoadSyntaxErrorSchema()
 {
     using (
         TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml)
         ) {
         XmlSchema schema;
         Assert.IsFalse(XmlHelper.TryLoadSchema(tempFile, out schema));
         Assert.IsNull(schema);
     }
 }
Exemplo n.º 6
0
 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); }
                 );
         }
     }
 }
Exemplo n.º 7
0
 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); }
                 );
         }
     }
 }
Exemplo n.º 8
0
        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
                }
            }
        }
Exemplo n.º 9
0
    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
        }
      }
    }
Exemplo n.º 10
0
 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); }
       );
     }
   }
 }
Exemplo n.º 11
0
 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); }
       );
     }
   }
 }
Exemplo n.º 12
0
 public void TestTryLoadSchema() {
   using(
     TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml)
   ) {
     XmlSchema schema;
     Assert.IsTrue(XmlHelper.TryLoadSchema(tempFile, out schema));
     Assert.NotNull(schema);
   }
 }
Exemplo n.º 13
0
 public void TestLoadSchema() {
   using(
     TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml)
   ) {
     XmlHelper.LoadSchema(tempFile);
   }
 }
Exemplo n.º 14
0
 public void TestFailOnTryLoadSyntaxErrorSchema() {
   using(
     TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml)
   ) {
     XmlSchema schema;
     Assert.IsFalse(XmlHelper.TryLoadSchema(tempFile, out schema));
     Assert.IsNull(schema);
   }
 }
Exemplo n.º 15
0
 public void TestThrowOnSyntaxErrorSchema() {
   using(
     TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml)
   ) {
     Assert.Throws<XmlSchemaException>(delegate() { XmlHelper.LoadSchema(tempFile); });
   }
 }
Exemplo n.º 16
0
 public void TestThrowOnInvalidSchema() {
   using(
     TempFileKeeper tempFile = new TempFileKeeper(brokenSchemaXml)
   ) {
     Assert.Throws<XmlException>(delegate() { XmlHelper.LoadSchema(tempFile); });
   }
 }