我需要为我们的某项服务编写一个规范,用于代码覆盖。问题的方法是:
public void RemoveOpenMortgageLoanAccount(int accountNumber)
{
using (var db = this.dbFactory.NewDb().InAppContext())
{
db.DeleteWhere<OpenMortgageLoanAccountsDataModel>(string.Format("AccountKey = {0}", accountNumber));
db.Complete();
}
}
我尝试了一些事情,但我无法理解这一点。它将类似于下面的示例,但我无法正确使用语法。
It should_remove_the_correct_mkortgage_loan_account = () =>
{
fakeDb.FakedDb
.InAppContext()
.WasToldTo(x => x.DeleteWhere<OpenMortgageLoanAccountsDataModel>(y => y.accountKey == accountKey));
};