我之前创建了许多 MSpec 类,但是在我最近创建的文件中运行单元测试给出了以下错误。有没有人在他们的单元测试中遇到过这个问题?
System.MissingMethodException:找不到方法:'System.String Machine.Specifications.Result.get_ConsoleOut()'。
这是代码:
[Subject(typeof(UsersDao))]
public class query_for_a_specific_user
{
private static Context context1;
private static Filter queryFilter;
private static List<User> users;
Establish context = () =>
{
context1 = new Context() { DatabaseId = 1 };
queryFilter = new Filter() { UserId = 1223 };
};
Because of = () => { users = UsersDao.GetUsers(context1, queryFilter); };
It should_not_be_null = () => users.ShouldNotBeNull();
It should_not_be_empty = () => users.ShouldNotBeEmpty();
}