我希望使用它来模拟System.Net.Mail.SmtpClient
在MS-Test UnitTest中的行为。因此,我添加了一个System.dll的伪装程序集。然后我创建了一个ShimsContext
和一个StubSmtpClient
。
using (ShimsContext.Create())
{
StubSmtpClient client = new StubSmtpClient();
}
但我该怎么做呢?
最终目标是编写一个测试,期望调用send
方法时使用MailMessage
对象。
System.Fakes.ShimSmtpClient
并不存在。唯一的Shims是针对Guid
和DateTime
的。 - user2900970