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