Beispiel #1
0
        public void TestTwoTablesWithSameNameButDifferentSchemas()
        {
            //SETUP
            using (var context = new BookOrderSchemaContext(_options))
            {
                var dtService       = context.GetDesignTimeService();
                var serviceProvider = dtService.GetDesignTimeProvider();
                var factory         = serviceProvider.GetService <IDatabaseModelFactory>();
#if NETCOREAPP2_1
                var database = factory.Create(_connectionString, new string[] { }, new string[] { });
#elif NETCOREAPP3_0
                var database = factory.Create(_connectionString,
                                              new DatabaseModelFactoryOptions(new string[] { }, new string[] { }));
#endif
                var handler = new Stage1Comparer(context.Model, nameof(BookOrderSchemaContext));

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(database);

                //VERIFY
                hasErrors.ShouldBeFalse();
                foreach (var log in CompareLog.AllResultsIndented(handler.Logs))
                {
                    _output.WriteLine(log);
                }
            }
        }
Beispiel #2
0
        public void ComparePropertySqlDefaultSelf()
        {
            //SETUP
            var options = GetDefaultSqlDbOptions();

            using (var context = new MyEntitySqlDefaultDbContext(options))
            {
                var dtService        = context.GetDesignTimeService();
                var serviceProvider  = dtService.GetDesignTimeProvider();
                var factory          = serviceProvider.GetService <IDatabaseModelFactory>();
                var connectionString = context.Database.GetDbConnection().ConnectionString;
                context.Database.EnsureCreated();
                var localDatabaseModel = factory.Create(connectionString, new string[] { }, new string[] { });

                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(localDatabaseModel);

                //VERIFY
                hasErrors.ShouldBeFalse();
                //CompareLog.ListAllErrors(handler.Logs).Single().ShouldEqual(
                //    "DIFFERENT: Property 'MyInt', value generated. Expected = OnAdd, found = Never");
            }
        }
Beispiel #3
0
        public void ComparePropertyComputedColSelf()
        {
            //SETUP
            var options = this.CreateUniqueClassOptions <MyEntityDbContext>(
                builder => builder.ReplaceService <IModelCacheKeyFactory, MyEntityModelCacheKeyFactory>());

            using (var context = new MyEntityDbContext(options, MyEntityDbContext.Configs.ComputedCol))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(context);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                //The setting of a computed col changed the column type
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(3);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyDateTime', column type. Expected = datetime, found = datetime2");
                errors[1].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyDateTime', computed column sql. Expected = getutcdate(), found = <null>");
                errors[2].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyDateTime', value generated. Expected = OnAddOrUpdate, found = Never");
            }
        }
Beispiel #4
0
        public void ComparePropertyComputedColSelf()
        {
            //SETUP
            var options = GetComputedColDbOptions();

            using (var context = new MyEntityComputedColDbContext(options))
            {
                var dtService        = context.GetDesignTimeService();
                var serviceProvider  = dtService.GetDesignTimeProvider();
                var factory          = serviceProvider.GetService <IDatabaseModelFactory>();
                var connectionString = context.Database.GetDbConnection().ConnectionString;
                context.Database.EnsureCreated();
#if NETCOREAPP2_1
                var localDatabaseModel = factory.Create(connectionString, new string[] { }, new string[] { });
#elif NETCOREAPP3_0
                var localDatabaseModel = factory.Create(connectionString,
                                                        new DatabaseModelFactoryOptions(new string[] { }, new string[] { }));
#endif

                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(localDatabaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                //The setting of a computed col changed the column type
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(1);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyDateTime', column type. Expected = datetime2, found = datetime");
            }
        }
Beispiel #5
0
        public void CompareDiffIndexes()
        {
            //SETUP
            var optionsBuilder = new DbContextOptionsBuilder <MyEntityIndexesDbContext>();

            optionsBuilder.UseSqlServer(_connectionString);
            using (var context = new MyEntityIndexesDbContext(optionsBuilder.Options))
            {
                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(_databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(3);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', column type. Expected = nvarchar(450), found = nvarchar(max)");
                errors[1].ShouldEqual(
                    "NOT IN DATABASE: MyEntity->Index 'MyInt', index constraint name. Expected = MySpecialName");
                errors[2].ShouldEqual(
                    "NOT IN DATABASE: MyEntity->Index 'MyString', index constraint name. Expected = IX_MyEntites_MyString");
            }
        }
Beispiel #6
0
        public void ComparePropertySqlDefaultReversed()
        {
            //SETUP
            var           options = GetDefaultSqlDbOptions();
            DatabaseModel localDatabaseModel;

            using (var context = new MyEntitySqlDefaultDbContext(options))
            {
                var dtService        = context.GetDesignTimeService();
                var serviceProvider  = dtService.GetDesignTimeProvider();
                var factory          = serviceProvider.GetService <IDatabaseModelFactory>();
                var connectionString = context.Database.GetDbConnection().ConnectionString;
                context.Database.EnsureCreated();
                localDatabaseModel = factory.Create(connectionString, new string[] { }, new string[] { });
            }

            using (var context = new MyEntityDbContext(_options))
            {
                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(localDatabaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(2);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyInt', default value sql. Expected = <null>, found = 123");
                errors[1].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyInt', value generated. Expected = Never, found = OnAdd");
            }
        }
Beispiel #7
0
        public void CompareDiffPrimaryKey()
        {
            //SETUP
            var optionsBuilder = new DbContextOptionsBuilder <MyEntityDiffPKeyDbContext>();

            optionsBuilder.UseSqlServer(_connectionString);
            using (var context = new MyEntityDiffPKeyDbContext(optionsBuilder.Options))
            {
                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(_databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(4);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyInt', value generated. Expected = OnAdd, found = Never");
                errors[1].ShouldEqual(
                    "NOT IN DATABASE: MyEntity->PrimaryKey 'PK_MyEntites', column name. Expected = MyInt");
                errors[2].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyEntityId', value generated. Expected = Never, found = OnAdd");
                errors[3].ShouldEqual(
                    "EXTRA IN DATABASE: MyEntity->PrimaryKey 'PK_MyEntites', column name. Found = MyEntityId");
            }
        }
Beispiel #8
0
        public void ComparePropertySqlDefaultSelf()
        {
            //SETUP
            var options = GetDefaultSqlDbOptions();

            using (var context = new MyEntitySqlDefaultDbContext(options))
            {
                var dtService        = context.GetDesignTimeService();
                var serviceProvider  = dtService.GetDesignTimeProvider();
                var factory          = serviceProvider.GetService <IDatabaseModelFactory>();
                var connectionString = context.Database.GetDbConnection().ConnectionString;
                context.Database.EnsureCreated();
#if NETCOREAPP2_1
                var localDatabaseModel = factory.Create(connectionString, new string[] { }, new string[] { });
#elif NETCOREAPP3_0
                var localDatabaseModel = factory.Create(connectionString,
                                                        new DatabaseModelFactoryOptions(new string[] { }, new string[] { }));
#endif

                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(localDatabaseModel);

                //VERIFY
                hasErrors.ShouldBeFalse();
            }
        }
Beispiel #9
0
        public void ComparePropertyComputedColNameReversed()
        {
            //SETUP
            var           options = GetComputedColDbOptions();
            DatabaseModel localDatabaseModel;

            using (var context = new MyEntityComputedColDbContext(options))
            {
                var dtService        = context.GetDesignTimeService();
                var serviceProvider  = dtService.GetDesignTimeProvider();
                var factory          = serviceProvider.GetService <IDatabaseModelFactory>();
                var connectionString = context.Database.GetDbConnection().ConnectionString;
                context.Database.EnsureCreated();
                localDatabaseModel = factory.Create(connectionString, new string[] { }, new string[] { });
            }

            using (var context = new MyEntityDbContext(_options))
            {
                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(localDatabaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(2);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyDateTime', column type. Expected = datetime2, found = datetime");
                errors[1].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyDateTime', computed column sql. Expected = <null>, found = getutcdate()");
            }
        }
Beispiel #10
0
        public void ComparePropertySqlDefaultName()
        {
            //SETUP
            var options = this.CreateUniqueClassOptions <MyEntityDbContext>(
                builder => builder.ReplaceService <IModelCacheKeyFactory, MyEntityModelCacheKeyFactory>());

            using (var context = new MyEntityDbContext(options, MyEntityDbContext.Configs.DefaultValue))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(context);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(4);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyDateTime', default value sql. Expected = '2000-01-01T00:00:00.0000000', found = <null>");
                errors[1].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyDateTime', value generated. Expected = OnAdd, found = Never");
                errors[2].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', default value sql. Expected = N'Hello!', found = <null>");
                errors[3].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', value generated. Expected = OnAdd, found = Never");
            }
        }
Beispiel #11
0
        public void ComparePropertyPersistentComputedColName()
        {
            //SETUP
            var options = this.CreateUniqueClassOptions <MyEntityDbContext>(
                builder => builder.ReplaceService <IModelCacheKeyFactory, MyEntityModelCacheKeyFactory>());

            using (var context = new MyEntityDbContext(options, MyEntityDbContext.Configs.PersistentComputedColumn))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(context);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(4);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', column type. Expected = nvarchar(30), found = nvarchar(max)");
                errors[1].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', computed column sql. Expected = CONVERT([nvarchar](30),[MyEntityId]+(1)), found = <null>");
                errors[2].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', persistent computed column. Expected = True, found = False");
                errors[3].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', value generated. Expected = OnAddOrUpdate, found = Never");
            }
        }
Beispiel #12
0
        public void CompareDiffIndexes()
        {
            //SETUP
            var options = this.CreateUniqueClassOptions <MyEntityDbContext>(
                builder => builder.ReplaceService <IModelCacheKeyFactory, MyEntityModelCacheKeyFactory>());

            using (var context = new MyEntityDbContext(options, MyEntityDbContext.Configs.HasUniqueIndex))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(context);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(3);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', column type. Expected = nvarchar(450), found = nvarchar(max)");
                errors[1].ShouldEqual(
                    "NOT IN DATABASE: MyEntity->Index 'MyInt', index constraint name. Expected = MySpecialName");
                errors[2].ShouldEqual(
                    "NOT IN DATABASE: MyEntity->Index 'MyString', index constraint name. Expected = IX_MyEntites_MyString");
            }
        }
Beispiel #13
0
        public void CompareDiffPrimaryKey()
        {
            //SETUP
            var options = this.CreateUniqueClassOptions <MyEntityDbContext>(
                builder => builder.ReplaceService <IModelCacheKeyFactory, MyEntityModelCacheKeyFactory>());

            using (var context = new MyEntityDbContext(options, MyEntityDbContext.Configs.DifferentPk))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(context);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(3);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyInt', value generated. Expected = OnAdd, found = Never");
                errors[1].ShouldEqual(
                    "NOT IN DATABASE: MyEntity->PrimaryKey 'PK_MyEntites', column name. Expected = MyInt");
                errors[2].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyEntityId', value generated. Expected = Never, found = OnAdd");
            }
        }
Beispiel #14
0
        public void CompareDefaultConfigNoErrors()
        {
            //SETUP
            using (var context = new MyEntityDbContext(_options))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(_databaseModel);

                //VERIFY
                hasErrors.ShouldBeFalse();
                var settings = new JsonSerializerSettings();
                settings.Converters.Add(new StringEnumConverter());
                var json = JsonConvert.SerializeObject(handler.Logs, settings);
            }
        }
Beispiel #15
0
        public void CompareExtraProperty()
        {
            //SETUP
            var optionsBuilder = new DbContextOptionsBuilder <MyEntityExtraPropDbContext>();

            optionsBuilder.UseSqlServer(_connectionString);
            using (var context = new MyEntityExtraPropDbContext(optionsBuilder.Options))
            {
                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(_databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                CompareLog.ListAllErrors(handler.Logs).Single().ShouldEqual(
                    "NOT IN DATABASE: MyEntity->Property 'ShadowProp', column name. Expected = ShadowProp");
            }
        }
Beispiel #16
0
        public void ComparePropertyDiffTypeName()
        {
            //SETUP
            var optionsBuilder = new DbContextOptionsBuilder <MyEntityPropertyDiffTypeDbContext>();

            optionsBuilder.UseSqlServer(_connectionString);
            using (var context = new MyEntityPropertyDiffTypeDbContext(optionsBuilder.Options))
            {
                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(_databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                CompareLog.ListAllErrors(handler.Logs).Single().ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', column type. Expected = varchar(max), found = nvarchar(max)");
            }
        }
Beispiel #17
0
        public void CompareSchemaConfig()
        {
            //SETUP
            var optionsBuilder = new DbContextOptionsBuilder <MyEntitySetSchemaDbContext>();

            optionsBuilder.UseSqlServer(_connectionString);
            using (var context = new MyEntitySetSchemaDbContext(optionsBuilder.Options))
            {
                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(_databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                CompareLog.ListAllErrors(handler.Logs).Single().ShouldEqual(
                    "NOT IN DATABASE: Entity 'MyEntity', table name. Expected = MySchema.MyEntities");
            }
        }
Beispiel #18
0
        public void ComparePropertyDiffTypeName()
        {
            //SETUP
            var options = this.CreateUniqueClassOptions <MyEntityDbContext>(
                builder => builder.ReplaceService <IModelCacheKeyFactory, MyEntityModelCacheKeyFactory>());

            using (var context = new MyEntityDbContext(options, MyEntityDbContext.Configs.StringIsAscii))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(context);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                CompareLog.ListAllErrors(handler.Logs).Single().ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyString', column type. Expected = varchar(max), found = nvarchar(max)");
            }
        }
Beispiel #19
0
        public void ComparePropertyDiffColName()
        {
            //SETUP
            var options = this.CreateUniqueClassOptions <MyEntityDbContext>(
                builder => builder.ReplaceService <IModelCacheKeyFactory, MyEntityModelCacheKeyFactory>());

            using (var context = new MyEntityDbContext(options, MyEntityDbContext.Configs.DifferentColName))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(context);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                CompareLog.ListAllErrors(handler.Logs).Single().ShouldEqual(
                    "NOT IN DATABASE: MyEntity->Property 'MyInt', column name. Expected = OtherColName");
            }
        }
Beispiel #20
0
        public void CompareTotalSchemaConfig()
        {
            //SETUP
            var options = this.CreateUniqueClassOptions <MyEntityDbContext>(
                builder => builder.ReplaceService <IModelCacheKeyFactory, MyEntityModelCacheKeyFactory>());

            using (var context = new MyEntityDbContext(options, MyEntityDbContext.Configs.WholeSchemaSet))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(context);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                CompareLog.ListAllErrors(handler.Logs).Single().ShouldEqual(
                    "NOT IN DATABASE: Entity 'MyEntity', table name. Expected = AllSchema.MyEntites");
            }
        }
Beispiel #21
0
        public void CompareDefaultConfigNoErrors()
        {
            //SETUP
            var options = this.CreateUniqueClassOptions <MyEntityDbContext>(
                builder => builder.ReplaceService <IModelCacheKeyFactory, MyEntityModelCacheKeyFactory>());

            using (var context = new MyEntityDbContext(options, MyEntityDbContext.Configs.NormalTable))
            {
                var model   = context.Model;
                var handler = new Stage1Comparer(context);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(databaseModel);

                //VERIFY
                hasErrors.ShouldBeFalse();
                var settings = new JsonSerializerSettings();
                settings.Converters.Add(new StringEnumConverter());
                var json = JsonConvert.SerializeObject(handler.Logs, settings);
            }
        }
Beispiel #22
0
        public void CompareSelfTestEfCoreContext()
        {
            //SETUP
            using (var context = new BookContext(_options))
            {
                var dtService       = context.GetDesignTimeService();
                var serviceProvider = dtService.GetDesignTimeProvider();
                var factory         = serviceProvider.GetService <IDatabaseModelFactory>();
                var database        = factory.Create(_connectionString, new string[] { }, new string[] { });
                var handler         = new Stage1Comparer(context.Model, nameof(BookContext));

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(database);

                //VERIFY
                hasErrors.ShouldBeFalse();
                foreach (var log in CompareLog.AllResultsIndented(handler.Logs))
                {
                    _output.WriteLine(log);
                }
            }
        }
Beispiel #23
0
        //------------------------------------------------------
        //private methods

        private bool FinishRestOfCompare(string configOrConnectionString, DbContext[] dbContexts, IDesignTimeServices designTimeService)
        {
            var  databaseModel = GetDatabaseModelViaScaffolder(dbContexts[0], configOrConnectionString, designTimeService);
            bool hasErrors     = false;

            foreach (var context in dbContexts)
            {
                var stage1Comparer = new Stage1Comparer(context.Model, context.GetType().Name, _logs, _config.LogsToIgnore);
                hasErrors |= stage1Comparer.CompareModelToDatabase(databaseModel);
            }

            if (hasErrors)
            {
                return(true);
            }

            //No errors, so its worth running the second phase
            var stage2Comparer = new Stage2Comparer(databaseModel, _config.LogsToIgnore);

            hasErrors = stage2Comparer.CompareLogsToDatabase(_logs);
            _logs.AddRange(stage2Comparer.Logs);
            return(hasErrors);
        }
Beispiel #24
0
        public void ComparePropertySqlDefaultName()
        {
            //SETUP
            var optionsBuilder = new DbContextOptionsBuilder <MyEntitySqlDefaultDbContext>();

            optionsBuilder.UseSqlServer(_connectionString);
            using (var context = new MyEntitySqlDefaultDbContext(optionsBuilder.Options))
            {
                var handler = new Stage1Comparer(context.Model, context.GetType().Name);

                //ATTEMPT
                var hasErrors = handler.CompareModelToDatabase(_databaseModel);

                //VERIFY
                hasErrors.ShouldBeTrue();
                var errors = CompareLog.ListAllErrors(handler.Logs).ToList();
                errors.Count.ShouldEqual(2);
                errors[0].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyInt', default value sql. Expected = 123, found = <null>");
                errors[1].ShouldEqual(
                    "DIFFERENT: MyEntity->Property 'MyInt', value generated. Expected = OnAdd, found = Never");
            }
        }