// 2 Approved, 4 pending, 3 rejected
var data = new List<Conference>
{
new Conference {Approved = true, Rejected = false},
new Conference {Approved = true, Rejected = false},
new Conference {Approved = false, Rejected = false},
new Conference {Approved = false, Rejected = false},
new Conference {Approved = false, Rejected = false},
new Conference {Approved = false, Rejected = false},
new Conference {Approved = false, Rejected = true},
new Conference {Approved = false, Rejected = true},
new Conference {Approved = false, Rejected = true}
};
Conference.ResetTestRepo();
Conference.Setup(data);
然后我的Repo类最终使用Find()执行这一行:
return Conference.Find(c => c.Approved).ToList();
问题是,它总是返回所有记录(9)。我试过不同的寻找标准,但都没有用。
有人知道问题是什么吗?我已尝试修复tt模板中的相等比较,如下所述:
Fixes for problems with SubSonic 3's TestRepository
但那没用。