DEV Community

Discussion on: Go tests - How to verify if something was called?

Collapse
 
gustavolopess profile image
Gustavo Lopes

actually the test of text is designed to component which has type Dog as dependency. Lhasa Apso is a “concrete” implementation of Dog, therefore you don’t need to mock a Dog to test its methods, you can test them directly :)

Collapse
 
marcello_h profile image
Marcelloh

I know you can test directly, but still I won't have any information about how many times a Lhasa was barking with your example. You will only know that from the fake-dog, and that's the one we're the least interested in, right?