2
我正在使用Mono和Lokad质量库来开发一个API,它可以执行诸如检查方法的特征以查看它们是否抛出异常等等。我该如何测试?
我在此API中的一个方法看起来像这样:
// Get all methods which have a NotImplementedException
var throwingMethods = _codebase.Methods
.Where(m => m.GetInstructions()
.Exists(i => i.Creates<NotImplementedException>())
).ToArray();
return throwingMethods;
我该如何测试这个? C#没有自己的本地功能来做同样的事情。也许我只需要一个小程序集,制作一个硬编码的集合,然后比较一下?
感谢