dimanche 17 janvier 2021

Make method return something just for the sake of testing it?

I have an async Task method which doesn't really return anything because all it does is migrate some data. However, I'd like to somehow test the method and all I can think of is making the method return a bool when it is completed (true if it does migrate the data, otherwise false), although it's completely unnecessary for the process, it's just for the xunit test. Is it considered bad practice to do so? Or is there perhaps another way to test an async Task?

Thank you in advance!

Aucun commentaire:

Enregistrer un commentaire