Ejemplo n.º 1
0
        // AS: this test fails with the message
        // "'abstract_element_definition__slot__members__abstract_element_definition'
        // is not a valid name.  Make sure that it
        // 'abstract_element_definition__slot__members__abstract_element_definition' is not a
        // valid name.  Make sure that it does not include invalid characters or punctuation
        // and that it is not too long.
        public void CreateFromOntology()
        {
            Helper.Print("\n---\n--- Starting CreateFromOntology\n---\n");

            DataSchemaAdapter creator = new JetDataSchemaAdapter();
            DataSet           dataSet = new DataSet(this.Catalog);

            string xsdFile = ConfigurationManager.AppSettings["Test.ObjectModelXsd"];

            if (xsdFile == null || xsdFile.Length == 0)
            {
                xsdFile = Path.Combine(TestContext.CurrentContext.TestDirectory, @"Test\ObjectModel.xsd");
            }

            dataSet.ReadXmlSchema(xsdFile);
            dataSet.DataSetName = this.Catalog;

            creator.Create(dataSet, true);

            Assertion.Assert(File.Exists(JetDataSchemaAdapter.GetPath(this.Catalog)));

            //
            // Can we open it?
            //
            using (IDbConnection connection = Connection())
            {
                connection.Open();
            }
        }
Ejemplo n.º 2
0
        public void CreateEmptyDB()
        {
            Helper.Print("\n---\n--- Starting CreateEmptyDB\n---\n");

            DataSchemaAdapter creator = new JetDataSchemaAdapter();
            DataSet           dataSet = new DataSet(this.Catalog);

            creator.Create(dataSet, true);

            Assertion.Assert(File.Exists(JetDataSchemaAdapter.GetPath(this.Catalog)));

            //
            // Can we open it?
            //
            using (IDbConnection connection = Connection())
            {
                connection.Open();
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 public void CleanUp()
 {
     File.Delete(JetDataSchemaAdapter.GetPath(Catalog));
 }