public void When_used_with_a_non_Azure_SQL_database_then_AzureSqlDbMigrator_is_applied_but_does_nothing()
        {
            // arrange
            Database.Delete(MigrationsTestReadModels.ConnectionString);

            using (var context = new MigrationsTestReadModels())
            {
                new CreateAndMigrate<MigrationsTestReadModels>().InitializeDatabase(context);

                var migrator = new AzureSqlDbMigrator(
                    serviceObjective: "S0",
                    edition: "standard",
                    maxSize: "500 MB",
                    migrationVersion: new Version("0.1.2.3"));

                // act
                context.EnsureDatabaseIsUpToDate(migrator);

                // assert
                var latestAppliedMigrationVersions = context.OpenConnection()
                                                            .GetLatestAppliedMigrationVersions();

                latestAppliedMigrationVersions
                    .Should()
                    .Contain(v => v.MigrationVersion.ToString() == "0.1.2.3");
            }
        }
        public void AzureSqlDatabase_ReadModel_can_be_configured_using_a_migration()
        {
            var databaseSettings = Settings.Get<AzureSqlDatabaseSettings>();
            databaseSettings.DatabaseName = "ItsCqrsMigrationsTestReadModels";
            var connectionString = databaseSettings.BuildConnectionString();

            using (var context = new MigrationsTestReadModels(connectionString, typeof (OrderTallyEntityModelConfiguration)))
            {
                new ReadModelDatabaseInitializer<MigrationsTestReadModels>().InitializeDatabase(context);

                var migrator = new AzureSqlDbMigrator(
                    serviceObjective: "S0",
                    edition: "standard",
                    maxSize: "500 MB",
                    migrationVersion: new Version("0.0.42.1"));

                context.EnsureDatabaseIsUpToDate(migrator);

                context.OpenConnection()
                       .GetLatestAppliedMigrationVersions()
                       .Should()
                       .Contain(v => v.MigrationVersion.ToString() == "0.0.42.1");
            }
        }