Use dependency injections for test. (Ninject.MockingKernel.Moq) - #661
Use dependency injections for test. (Ninject.MockingKernel.Moq)#661bnordli wants to merge 1 commit into
Conversation
|
I know this is super late to be discussing this; but its been a hectic 18 months :) Anywho. Why would one need to have the IoC container involved when writing specs? |
|
Welcome back! :) It is certainly debatable, but we have found it to greatly simplify writing specs:
btw, this has already been accepted into the ProCoSys fork here: ProCoSys#11 |
|
:) Thanks. Its good to be back. Thanks for the clarification. I think I see and understand the need, but I'm still reluctant to use the IOC for this. I think it would be better to have something that optimized for developer experience surrounding this. Let me sleep another fourthnight on it. :) I'll keep the PR here - please don't close it in any way - good for reference and me understanding it all.. |
|
What else would you like to use? It would certainly be possible to write a custom tool for this, but as the project already uses Moq for mocking, and has an implementation for Ninject, both should be familiar to developers, so it sounds reasonable to use an existing framework to do this. (To be fair, there are no direct dependencies from the test themselves to Ninject.) The possible downsides I can see are
|
|
Seems like Ninject.MockingKernel does not support .NET Core (yet). So either we have to wait for it to get updated, or use another DI framework. |
|
Marked for waiting |
Just a suggestion to simplify testing