Match.Create
与 Moq 一起使用时,我有一个奇怪的行为。
当我提取Match.Create
为变量时,以下代码片段未通过:
var mock = new Mock<IA>();
mock.Object.Method ("muh");
mock.Verify (m => m.Method (Match.Create<string> (s => s.Length == 3)));
public interface IA
{
void Method (string arg);
}
是什么原因?