3 ms·
Not sure about Java, but at least in C# there are clear advantages to using interfaces over concrete classes when using Moq.
by yawgmoth 7y ago
Not sure about Java, but at least in C# there are clear advantages to using interfaces over concrete classes when using Moq.
- GordonS 7y agoInterfaces are not the only option - you can also mark methods as virtual. But overuse of mocking is a very big problem in a lot of codebases. Often I look at a test, and all it seems to do is setup mocks, such that I'm not sure if anything is actually being tested! My hope is that C#'s new default interface implementations feature will put an end to this mess.