1

Currently we use Moq to verify that a method has been called with the correct parameters, however this requires the method to actually be mocked resulting in loads of bloat in the class. I would rather use the actual implementation.

Can I use Moq to default to the implementation if it hasn't been SetUp? Or is there an alternative way to verify the method has been called?

GMon
  • 638
  • 6
  • 14
  • 2
    Would be cool to see some code. Other than that it looks like `.CallBase = true` on the mock should solve your problem provided the class is not sealed. – Nkosi Sep 04 '19 at 13:48
  • Well, you use Moq to abstract *away* from actual implementation, so even if it's harder, you've got the benefit of actually *unit* testing. – Piotr Falkowski Sep 04 '19 at 14:43

0 Answers0