运行以下测试时,所有断言都失败。无法弄清楚它们为什么会失败,因为实际的实现确实调用了对象。
这是一个已知的错误?因为其他一些测试确实成功了。
[Subject("Pst Cleanup")]
public class When_running_Pst_CleanUp
{
Establish context = () =>
{
_folders = A.Fake<IOutlookFolderParameters>();
_processor = A.Fake<IOutlookPstCleaner>();
};
Because of = () => _processor.Cleanup(_folders);
It should_cleanup_the_mail_folder = () => A.CallTo(() => _folders.EmailFolder).MustHaveHappened();
It should_cleanup_tasks_folder = () => A.CallTo(() => _folders.TaskFolder).MustHaveHappened();
It should_cleanup_appointments_folder = () => A.CallTo(() => _folders.AppointmentFolder).MustHaveHappened();
private static IOutlookPstCleaner _processor;
private static IOutlookFolderParameters _folders;
}
以下调用的断言失败:Outlook.Contracts.IOutlookFolderParameters.get_NotificationsFolder() 预计至少会找到一次,但没有对假对象进行调用。
在 FakeItEasy.Core.FakeAsserter.AssertWasCalled(Func
2 callPredicate, String callDescription, Func
2 repeatPredicate, String repeatDescription) 在 FakeItEasy.Configuration.RuleBuilder.MustHaveHappened(Repeated repeatConstraint) 在 UnitTests.When_running_Pst_CleanUp.<.ctor>b__2() 在 When_running_Pst_CleanUp.cs:第 19 行