Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道,如何在 Visual Studio 2010 的单元测试中调用返回 IEnumerable 的方法。我正在使用 rhino mocks 模拟框架。
像这样的东西应该是你正在寻找的东西:
var expectedDatasets = new List<Dataset>{new Dataset()}; Expect.Call(service.FindDatasets()).Return(expectedDatasets);
由于 List 实现了 IEnumerable 接口,因此您可以说您期望它;