Ejemplo n.º 1
0
        public void Can_detect_renamed_modification_functions_when_many_to_many()
        {
            var commandTreeGenerator
                = new ModificationCommandTreeGenerator(TestContext.CreateDynamicUpdateModel());

            var targetModel = new TestContext_v2b().GetModel();

            var renameProcedureOperations
                = new EdmModelDiffer()
                    .Diff(
                        new TestContext().GetModel(),
                        targetModel,
                        new Lazy<ModificationCommandTreeGenerator>(() => commandTreeGenerator),
                        new SqlServerMigrationSqlGenerator())
                    .OfType<RenameProcedureOperation>()
                    .ToList();

            Assert.Equal(1, renameProcedureOperations.Count);
            Assert.Equal(1, renameProcedureOperations.Count(c => c.NewName == "m2m_insert"));
        }
Ejemplo n.º 2
0
        public void Can_detect_changed_modification_functions_when_many_to_many()
        {
            var commandTreeGenerator
                = new ModificationCommandTreeGenerator(TestContext.CreateDynamicUpdateModel());

            var targetModel = new TestContext_v2b().GetModel();

            var alterProcedureOperations
                = new EdmModelDiffer()
                    .Diff(
                        new TestContext().GetModel(),
                        targetModel,
                        new Lazy<ModificationCommandTreeGenerator>(() => commandTreeGenerator),
                        new SqlServerMigrationSqlGenerator())
                    .OfType<AlterProcedureOperation>()
                    .ToList();

            Assert.Equal(2, alterProcedureOperations.Count);
            Assert.Equal(1, alterProcedureOperations.Count(ap => ap.Parameters.Any(p => p.Name == "order_thing_id")));
            Assert.Equal(1, alterProcedureOperations.Count(ap => ap.Parameters.Any(p => p.Name == "order_id")));
        }