4

Beginning a project with TDD and debating Mocks, it appears the popular choices of a few years back are hit and miss as far as activeness goes. (Moq, Rhino Mocks)

Once you start using e.g. Rhino Mocks (using DI, DDD, etc.) does it quickly become a case of getting tied to the Library? Once you start and have an app built up with a mocking library it seems like it would be a fairly significant change to try use a different framework.

It looks like the syntax and methodology are quite different (at an initial very brief glance) so it's a little disturbing thinking about committing to a Mock framework especially when both have been pretty stale (.NET 4, last changes 2011, etc.) for a while and only now the Rhino Mocks is being taken over by someone new.

Initially the TDD unit tests will probably be just using the Visual Studio attributes.

It seems like most of the questions about the frameworks themselves are 2+ years old, kind of like the last changes.

4

1 回答 1

1

虽然可以为依赖注入容器创建自己的模拟抽象接口,类似于Common Service Locator抽象,但大多数人会继续创建对特定模拟库的依赖。

正如评论中所指出的那样,这种情况非常罕见,以至于您可能想要更改模拟框架,以至于这种抽象不被视为值得投资回报。

于 2013-06-04T15:10:10.850 回答