public void CreateTableDefinition() { var schemaChecker = new SqliteSchemaChecker(DataStore); var tableDefinition = schemaChecker.GetTableFormat("EntityDefinition"); Assert.AreEqual(EntityDefinition.TableDefinition, tableDefinition); }
public void CreateTable_WithOneForeignKeyAttribute_ShouldCreateConstraint() { DataStore.Insert(new Book()); var schemaChecker = new SqliteSchemaChecker(DataStore); Assert.IsTrue(schemaChecker.IsForeignKeyExist("BookVersion", "Book")); }
public void CreateOrUpdateStore_LateAddEntity_ShouldUpdateDb() { DataStore.AddType<LateAddItem>(); DataStore.CreateOrUpdateStore(); var expected = new TableDefinition("LateAddItem"); expected.AddColumn("Id", 0, false, "INTEGER"); expected.AddColumn("Name", 1, true, "TEXT"); var schemaChecker = new SqliteSchemaChecker(DataStore); var current = schemaChecker.GetTableFormat("LateAddItem"); Assert.AreEqual(expected, current); }
public override void SetUp() { base.SetUp(); SchemaChecker = new SqliteSchemaChecker(DataStore); }
public void CreateTable_WithOnePrimaryKeyAttribute_ShouldCreateConstraint() { var schemaChecker = new SqliteSchemaChecker(DataStore); Assert.IsTrue(schemaChecker.IsPrimaryKeyExist("Book")); }