我正在尝试使用Moles运行NUnit,我遇到了一个奇怪的错误,我不太确定原因。
[Test]
[Moled]
public void SendEmail_Test()
{
SIEmailService emailService = new SIEmailService
{
SendMailStringStringString = (email, subject, body) => { }
};
SIServiceLocator serviceLocator = new SIServiceLocator();
serviceLocator.GetInstance(() => emailService);
MLocatorFactory.GetInstance = (() => serviceLocator);
IEmailservice = new EmailService();
service.SendEmail("someone@there.com", null, null, null, DateTime.Now, null);
}
错误:
有关如何修复此部分受信任的来电者问题的任何建议????非常感谢。