Exemplo n.º 1
0
        public void Dispatches_visitor()
        {
            var createIndexOperation = new CreateIndexOperation(
                "dbo.MyTable", "MyIndex", new[] { "Foo", "Bar" },
                isUnique: true, isClustered: true);
            var mockVisitor = MigrationsTestHelpers.MockSqlGenerator();
            var builder     = new Mock <SqlBatchBuilder>();

            createIndexOperation.GenerateSql(mockVisitor.Object, builder.Object);

            mockVisitor.Verify(g => g.Generate(createIndexOperation, builder.Object), Times.Once());
        }
Exemplo n.º 2
0
        public void Dispatches_visitor()
        {
            var createIndexOperation = new CreateIndexOperation(
                "dbo.MyTable", "MyIndex", new[] { "Foo", "Bar" },
                isUnique: true, isClustered: true);
            var mockVisitor = new Mock <MigrationOperationSqlGenerator>(new RelationalTypeMapper());
            var builder     = new Mock <IndentedStringBuilder>();

            createIndexOperation.GenerateSql(mockVisitor.Object, builder.Object);

            mockVisitor.Verify(g => g.Generate(createIndexOperation, builder.Object), Times.Once());
        }