mercredi 25 mars 2015

C++ fake/mock return value based on the value of parameter

Using Typemock Isolator++. Is it possible that the returning value from a fake method is based on the value of parameter?


for example:



WHEN_CALLED(student->GradeOfCourse("a")).ReturnVal(70);
WHEN_CALLED(student->GradeOfCourse("b")).ReturnVal(85);


then if the parameter is ("a"), it will return 70.


and if the parameter is ("b") then it will return 85.


Aucun commentaire:

Enregistrer un commentaire