jeudi 22 novembre 2018

To use implemented methods in the tests are good or bad idea?

I am testing a method, that in some cases return a new object and in some cases returns an existing object but updated.

I have a method that creates a new object in a default state, so i am wondering if it would be a good idea to use this method in the tests of the new method to check if it is a new object or not, so I could reuse code and not check all the properties one by one, because I can use another method to compare both objects.

But I have doubts about if it is a good idea to use this kind of methods in the tests.

Thanks.

Aucun commentaire:

Enregistrer un commentaire