Ejemplo n.º 1
0
 public void GetSchema_Throws_NDbUnit_Exception_When_Not_Initialized()
 {
     using (IDisposableDbCommandBuilder builder = GetDbCommandBuilder())
     {
         try
         {
             builder.GetSchema();
             Assert.Fail("Expected Exception of type NDbUnitException not thrown!");
         }
         catch (NDbUnitException ex)
         {
             Assert.IsNotNull(ex);
         }
     }
 }
Ejemplo n.º 2
0
        public void GetSchema_Contains_Proper_Tables()
        {
            using (IDisposableDbCommandBuilder builder = GetDbCommandBuilder())
            {
                builder.BuildCommands(GetXmlSchemaFilename());
                DataSet schema = builder.GetSchema();

                IList <string> schemaTables = new List <string>();

                foreach (DataTable dataTable in schema.Tables)
                {
                    schemaTables.Add(dataTable.TableName);

                    Console.WriteLine("Table '" + dataTable.TableName + "' found in dataset");
                }

                Assert.AreEqual(EXPECTED_COUNT_OF_COMMANDS, schema.Tables.Count, string.Format("Should be {0} Tables in dataset", EXPECTED_COUNT_OF_COMMANDS));
                Assert.That(ExpectedDataSetTableNames, Is.EquivalentTo(schemaTables));
            }
        }
 public void _SetUp()
 {
     _commandBuilder = GetDbCommandBuilder();
     ExecuteSchemaCreationScript();
     _commandBuilder.BuildCommands(GetXmlSchemaFilename());
 }
Ejemplo n.º 4
0
 public void _SetUp()
 {
     _commandBuilder = GetDbCommandBuilder();
     ExecuteSchemaCreationScript();
     _commandBuilder.BuildCommands(GetXmlSchemaFilename());
 }