Beispiel #1
0
        public void CreateTableDefinition()
        {
            var schemaChecker   = new SqliteSchemaChecker(DataStore);
            var tableDefinition = schemaChecker.GetTableFormat("EntityDefinition");

            Assert.AreEqual(EntityDefinition.TableDefinition, tableDefinition);
        }
Beispiel #2
0
        public void CreateTable_WithOneForeignKeyAttribute_ShouldCreateConstraint()
        {
            DataStore.Insert(new Book());
            var schemaChecker = new SqliteSchemaChecker(DataStore);

            Assert.IsTrue(schemaChecker.IsForeignKeyExist("BookVersion", "Book"));
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public override void SetUp()
 {
     base.SetUp();
     SchemaChecker = new SqliteSchemaChecker(DataStore);
 }
Beispiel #5
0
        public void CreateTable_WithOnePrimaryKeyAttribute_ShouldCreateConstraint()
        {
            var schemaChecker = new SqliteSchemaChecker(DataStore);

            Assert.IsTrue(schemaChecker.IsPrimaryKeyExist("Book"));
        }