我正在考虑将EF Migrations用于我们的数据库。我想创建单元测试来验证是否正确创建了迁移。 (Aka CreateTable(" Foobar")被召唤。) 我看到DbMigration类继承自IDbMigrations,CreateTable不是接口的一部分。
有没有办法验证是否使用正确的参数调用了CreateTable(...),PrimaryKey(...)等?
非常感谢
我想测试的例子
public partial class InitialSchema : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.address_book",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(nullable: false, maxLength: 125, unicode: false),
description = c.String(maxLength: 255, unicode: false),
})
.PrimaryKey(t => t.id);
}
}