Пример #1
0
        public void GetSchemaSet()
        {
            SchemaLoaderBase schemaBaseMock = new SchemaLoaderBaseMock("http://www.re-motion.org/Core/Test/Xml/SchemaLoaderBaseMock");
            XmlSchemaSet     xmlSchemaSet   = schemaBaseMock.LoadSchemaSet();

            Assert.That(xmlSchemaSet.Count, Is.EqualTo(1));
            Assert.That(xmlSchemaSet.Contains("http://www.re-motion.org/Core/Test/Xml/SchemaLoaderBaseMock"), Is.True);
        }
Пример #2
0
        public void GetSchemaWithSchemaFile()
        {
            SchemaLoaderBaseMock schemaBaseMock = new SchemaLoaderBaseMock("http://www.re-motion.org/Core/Test/Xml/SchemaLoaderBaseMock");
            XmlSchema            xmlSchema      = schemaBaseMock.LoadSchema("SchemaLoaderBaseMock.xsd");

            Assert.That(xmlSchema, Is.Not.Null);
            Assert.That(xmlSchema.TargetNamespace, Is.EqualTo("http://www.re-motion.org/Core/Test/Xml/SchemaLoaderBaseMock"));
        }
Пример #3
0
        public void GetSchemaReaderWithInvalidFileName()
        {
            try
            {
                SchemaLoaderBaseMock schemaBaseMock = new SchemaLoaderBaseMock("http://www.re-motion.org/Core/Test/Xml/SchemaLoaderBaseMock");
                schemaBaseMock.LoadSchema("invalidSchemaFileName.xsd");

                Assert.Fail("ApplicationException was expected.");
            }
            catch (ApplicationException ex)
            {
                string expectedMessage = string.Format(
                    "Error loading schema resource 'invalidSchemaFileName.xsd' from assembly '{0}'.", typeof(SchemaLoaderBaseMock).Assembly.FullName);

                Assert.That(ex.Message, Is.EqualTo(expectedMessage));
            }
        }