TDD with Mocks all the eggs in the basket?

Starting a project with TDD and debating Mocks, it seems that a popular choice a few years ago amazes and misses how active it is. (Moq, Rhino Mocks)

Once you start using, for example, Rhino Mocks (using DI, DDD, etc.) Does this quickly become a library binding? After you launch the application and make money with the mocking library, it looks like it will be a pretty significant change to try using a different structure.

The syntax and methodology seem to be completely different (at the initial very short glance), so it's a little disturbing to think about fixing the Mock structure, especially when both were pretty obsolete (.NET 4, recent changes 2011, etc.) .. ) for a while, and only now Rhino Mocks is capturing someone new.

Initially, TDD unit tests are likely to simply use Visual Studio attributes.

Most of the questions about the structures themselves seem to be 2+ years old, like recent changes.

+4
source share
1 answer

While you could create your own mocking abstraction interface, similar to the Common Service Locator abstraction for dependency injection containers, most people go ahead and create a dependency on a particular mocking library.

As noted in the comments, cases are so rare that you might want to change the mocking structure that such an abstraction is not considered a return on investment value.

+1
source

Source: https://habr.com/ru/post/1483125/


All Articles