Right now I am deep in mocking hell, where everything was mocked - whenever I change any code of the services, at least 1 test breaks, even if no behaviour was changed. This makes so much more sense than my way - i just make the mock partial, ignore missing calls and mock the return values of anything that is needed. Still makes the code ugly and needs fiddling until it works. Thanks for the video!
Жыл бұрын
Thanks for watching and I’m glad I could be of help!
@stevebauman Жыл бұрын
While I definitely like fakes and I think they are a great way to test, I will personally never default to them, and I think there has to be justification for them. They all come with additional baggage that mocking simply doesn't have: 1. Additional time to setup, and you have to now have to worry about designing your fakes assertion API 2. Lots of additional boilerplate for anything you would initially want to mock 3. Fakes now need their own tests, as they now encompass additional logic to make assertions, which could break, and may have their own bugs 4. Test code is now intertwined with application code
Жыл бұрын
Steve! Thanks for chiming in dude. I think the setup time is very minimal in regards to the benefits - setting up an interface and a different implementation is something you’re only going to do once. IME the annoyances I had with mocks throughout my life totally justify spending time with fakes. Obviously that’s very different with e.g library code where mocking happens frequently. You can easily remove coupling with the testing framework by having assertions within the test (if that’s what you meant, otherwise if it’s the in memory implementation being a test implemented intertwined with app code, I disagree). I just can’t see the benefits of mocks these days if fakes are an option.
@stevebauman Жыл бұрын
@ Fair enough! Great video by the way and thanks for the reply! 🙏
@erfansabouri7362 Жыл бұрын
Thanks. You lighten me up.
Жыл бұрын
Glad I could be of help :-)
@oleksiiberestniev5432 Жыл бұрын
many thanks
Жыл бұрын
Welcome!!
@chhirag Жыл бұрын
Thanks for the video, very well explained.
Жыл бұрын
Glad it was helpful!
@metaphoricallyspeaking Жыл бұрын
Awesome video Mateus 👏
Жыл бұрын
Thanks buddy!
@user-bk1ts4th2h Жыл бұрын
nice videos ! , thank you , please can you make videos inside playlists
Жыл бұрын
Thanks for the idea!
@Alguem387 Жыл бұрын
wait i though fake objects and mocking where the same thing
Жыл бұрын
They’re both test doubles and serve the same purpose 👍