Esempio n. 1
0
        public void CreateTableDefinition()
        {
            var schemaChecker   = new SqlCeSchemaChecker(DataStore);
            var tableDefinition = schemaChecker.GetTableFormat("EntityDefinition");

            Assert.AreEqual(EntityDefinition.TableDefinition, tableDefinition);
        }
Esempio n. 2
0
        public void CreateOrUpdateStore_LateAddEntity_ShouldUpdateDb()
        {
            DataStore.AddType <LateAddItem>();

            DataStore.CreateOrUpdateStore();

            var expected = new TableDefinition("LateAddItem");

            expected.AddColumn("Id", 1, false, "int");
            expected.AddColumn("Name", 2, true, "nvarchar");

            var schemaChecker = new SqlCeSchemaChecker(DataStore);
            var current       = schemaChecker.GetTableFormat("LateAddItem");

            Assert.AreEqual(expected, current);
        }
Esempio n. 3
0
        public void CreateTable_WithOneForeignKeyAttribute_ShouldCreateConstraint()
        {
            var schemaChecker = new SqlCeSchemaChecker(DataStore);

            Assert.IsTrue(schemaChecker.IsForeignKeyExist("ORM_FK_BookVersion_Book"));
        }