Esempio n. 1
0
        public Issue032Tests()
        {
            var filepath = TestData.GetFilePath("AlterMyClassesToNotHaveAPrimaryKey.sql");

            _options = this.CreateUniqueClassOptions <Issue32Context>();
            using (var context = new Issue32Context(_options))
            {
                context.Database.EnsureCreated();
                context.ExecuteScriptFileInTransaction(filepath);
            }
        }
Esempio n. 2
0
        public void TestHandlesTableNoKey()
        {
            //SETUP
            using (var context = new Issue32Context(_options))
            {
                var comparer = new CompareEfSql();

                //ATTEMPT
                var hasErrors = comparer.CompareEfWithDb(context);

                //VERIFY
                hasErrors.ShouldBeTrue();
                comparer.GetAllErrors.ShouldEqual(@"DIFFERENT: MyClass->PrimaryKey 'PK_MyClasses', constraint name. Expected = PK_MyClasses, found = - no primary key -
NOT IN DATABASE: MyClass->Property 'Id', column name. Expected = Id
DIFFERENT: Entity 'MyClass', constraint name. Expected = PK_MyClasses, found = - no primary key -");
            }
        }