示例#1
0
        public void Dispatches_visitor()
        {
            var dropPrimaryKeyOperation = new DropPrimaryKeyOperation("dbo.MyTable", "MyPK");
            var mockVisitor             = MigrationsTestHelpers.MockSqlGenerator();
            var builder = new Mock <SqlBatchBuilder>();

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

            mockVisitor.Verify(g => g.Generate(dropPrimaryKeyOperation, builder.Object), Times.Once());
        }
        public void Dispatches_visitor()
        {
            var dropPrimaryKeyOperation = new DropPrimaryKeyOperation("dbo.MyTable", "MyPK");
            var mockVisitor             = new Mock <MigrationOperationSqlGenerator>(new RelationalTypeMapper());
            var builder = new Mock <IndentedStringBuilder>();

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

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