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 :)
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?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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 :)
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?