vendredi 4 mars 2016

c# unit test override method

I am relatively new to Unit testing and I was wondering if there is a built in solution for the following problem.

I want to test a method which at one point measures some input from a hardware.

var results = Measurement.MeasureAll();

I want of course to test this without the hardware. Is there a way to override somehow for the scope of the unit test the Measurement.MeasureAll(); method to return some predefined values?

Aucun commentaire:

Enregistrer un commentaire