4 ms·
So I can mock it out for unit tests.
by rawling 1y ago
So I can mock it out for unit tests.
- jen20 1y agoThen you have two implementations…
- orphea 1y agoYou don't necessarily need to implement interfaces [in your code] to stub them in unit tests: var calculator = Substitute.For<ICalculator>();
- jen20 1y agoIf you’re doing that, you may as just mock your concrete class. Mockito supports this in Java. Perhaps this is needed in C#?
- wordofx 1y agoJava is virtual by default. C# is not. You could mark every single method virtual and mock it like Java. But it’s easier to define a contract and mock that.
- rawling 1y agoNot one that shows up when I hit "go to implementation".
- wordofx 1y agoLOL ok so you’ve never used C#