public void CompareSchema()
        {
            var superSetConnectionString = ConfigurationManager.ConnectionStrings["Persistence"].ConnectionString;
            var subSetConnectionString   = ConfigurationManager.ConnectionStrings["PersistenceEF"].ConnectionString;

            SqlServerSchema.Remove(subSetConnectionString);

            var configuration = new EntityFrameworkDbContextConfiguration <CompareContext>(connectionStringOrName => new CompareContext(connectionStringOrName));

            configuration.ConnectionString(subSetConnectionString);
            configuration.CreateSchema();

            SqlServerSchema.AssertContained(new ConsoleLogger(), superSetConnectionString, subSetConnectionString, false, "__MigrationHistory");
        }
Exemple #2
0
        public void CompareSchema()
        {
            var superSetConnectionString = ConfigurationManager.ConnectionStrings["Persistence"].ConnectionString;
            var subSetConnectionString   = ConfigurationManager.ConnectionStrings["PersistenceEF"].ConnectionString;

            SqlServerSchema.Remove(subSetConnectionString);

            var configuration = new EntityFrameworkConfiguration();

            configuration.ConnectionString(subSetConnectionString);
            configuration.ProviderName(EntityFrameworkConfiguration.SqlServerProviderName);
            configuration.RegisterEntitiesFromAssemblyOf <FooConfiguration>();
            configuration.CreateSchema();

            SqlServerSchema.AssertContained(new ConsoleLogger(), superSetConnectionString, subSetConnectionString, false, "EdmMetadata");
        }
Exemple #3
0
        private void CompareSchema(string subSetConnectionString, params INHibernateConfigurer[] configurers)
        {
            var superSetConnectionString = ConfigurationManager.ConnectionStrings["Persistence"].ConnectionString;

            SqlServerSchema.Prepare(subSetConnectionString);

            var configuration = new NHibernateConfiguration(new ConsoleLogger {
                DebugLoggingIsEnabled = false
            });

            foreach (var configurer in configurers)
            {
                configuration.RegisterConfigurer(configurer);
            }

            configuration.CreateSchema();

            SqlServerSchema.AssertContained(new ConsoleLogger(), superSetConnectionString, subSetConnectionString, false);
        }