Just read about the new Stubs & Shims support in Visual Studio 11.
Stubs are clear to me, but Shims? Are they an alternative for Moles? Or can they be used to do mocking?
Just read about the new Stubs & Shims support in Visual Studio 11.
Stubs are clear to me, but Shims? Are they an alternative for Moles? Or can they be used to do mocking?
在我看来,它们不仅仅是 Moles 的替代品,它们实际上是替代品。垫片可用于隔离您正在测试的代码,类似于 Moles。
来自Moles 的 Microsoft Research 页面:
Visual Studio 2012 中的 Fakes Framework 是下一代 Moles & Stubs。然而,Fakes 与 Moles 不同,因此从 Moles 转移到 Fakes 将需要对您的代码进行一些修改。Visual Studio 2012 将不支持 Moles 框架。