public void Create() { Utilities.SQL.DataClasses.Database Database = new Utilities.SQL.DataClasses.Database("TestDatabase"); Utilities.SQL.DataClasses.Table Table = Database.AddTable("TestTable"); Assert.Equal(Table, Database.Tables[0]); Assert.Equal("TestTable", Table.Name); }
public void AddTable() { Utilities.SQL.DataClasses.Database Database = new Utilities.SQL.DataClasses.Database("TestDatabase"); Database.AddTable("TestTable"); Assert.Equal(1, Database.Tables.Count); Assert.Equal("TestTable", Database.Tables.First().Name); Assert.Equal(Database, Database.Tables.First().ParentDatabase); }
public void AddTable() { Utilities.SQL.DataClasses.Database Database = new Utilities.SQL.DataClasses.Database("TestDatabase"); Database.AddTable("TestTable"); Assert.Equal(1, Database.Tables.Count); Assert.Equal("TestTable", Database.Tables[0].Name); Assert.Equal(Database, Database.Tables[0].ParentDatabase); }
public void AddColumns() { Utilities.SQL.DataClasses.Database Database = new Utilities.SQL.DataClasses.Database("TestDatabase"); Utilities.SQL.DataClasses.Table Table = Database.AddTable("TestTable"); IColumn Column = Table.AddColumn<int>("Column1", DbType.Int32); Assert.Equal(Column, Table.Columns[0]); Assert.Equal("Column1", Column.Name); Assert.Equal(DbType.Int32, Column.DataType); Assert.Equal("", Column.Default); }
public void Create() { Utilities.SQL.DataClasses.Database Database = new Utilities.SQL.DataClasses.Database("TestDatabase"); Utilities.SQL.DataClasses.Table Table = Database.AddTable("TestTable"); Utilities.SQL.DataClasses.Trigger TempTrigger = Table.AddTrigger("Trigger", "Definition", TriggerType.INSERT); Assert.Equal(TempTrigger, Table.Triggers[0]); Assert.Equal("Trigger", TempTrigger.Name); Assert.Equal("Definition", TempTrigger.Definition); Assert.Equal(TriggerType.INSERT, TempTrigger.Type); Assert.Equal(Table, TempTrigger.ParentTable); }
public void AddColumns() { Utilities.SQL.DataClasses.Database Database = new Utilities.SQL.DataClasses.Database("TestDatabase"); Utilities.SQL.DataClasses.Table Table = Database.AddTable("TestTable"); IColumn Column = Table.AddColumn <int>("Column1", DbType.Int32); Assert.Equal(Column, Table.Columns[0]); Assert.Equal("Column1", Column.Name); Assert.Equal(DbType.Int32, Column.DataType); Assert.Equal("", Column.Default); }