Why do we need mocking frameworks?

后端 未结 11 1760
清歌不尽
清歌不尽 2020-12-30 03:00

I have worked with code which had NUnit test written. But, I have never worked with mocking frameworks. What are they? I understand dependency injection and how it helps to

11条回答
  •  无人及你
    2020-12-30 03:19

    You can create mock objects by hand and use them during testing using Dependency Injection frameworks...but letting a mocking framework generate your mock objects for you saves time.

    As always, if using the framework adds too much complexity to be useful then don't use it.

提交回复
热议问题