I want to test the communication between some methods using mock. The only problem is that I want to do it without implementing an interface. Is that possible? I just read a lot of topics and some tutorials about mock objects, but all of them used to mock interfaces, and not the classes. I tried to use Moq frameworks.
Asked
Active
Viewed 46 times
1
-
Good question, but already asked and answered several times. For example here: https://stackoverflow.com/questions/12174304/is-it-recommended-to-mock-concrete-class – johey Nov 16 '18 at 08:08
1 Answers
0
I have to less reputations for a comment. Please check out the SOLID principle. You should really use interfaces. If you really don´t want to use interfaces just make your methods or properties virtual and moq is able to override it with the setup.

RichyP7
- 31
- 5