mardi 13 août 2019

How to test just a repository without code

We are creating tests for all the project but the code is on production and we cannot change any code even if it's not good. My question is, I have to test a service that just has 1 line that brings data from the database, it is a UnitOfWork using a repostory that brings a List.

I've used a Verify that verifies if that repository is called and just 1 time. However, my Pull Request wasn't approved because I didn't mock the results. They want me to mock all a list results and match if what I put on the Arrange is the same than what the respository "is bringing". I don't get it. This point is right?

Aucun commentaire:

Enregistrer un commentaire