Hi
I have the following function I would like to test:
bool QualityLib::isGood(int quality)
{
MSC_NAMESPACE::ObjectQuality objectQuality;
objectQuality.setValue(quality);
return objectQuality.isGood();
}
Here is my test:
void tst_QualityLib::isGood()
{
ObjectQuality *fakeObjectQuality = FAKE_ALL<ObjectQuality>();
WHEN_CALLED(fakeObjectQuality->isGood()).ReturnVal(true);
const int QUALITY = 192;
QualityLib qualityLib(0);
bool result = qualityLib.isGood(QUALITY);
ASSERT_WAS_CALLED (fakeObjectQuality->setValue(_));
ASSERT_WAS_CALLED (fakeObjectQuality->isGood());
QCOMPARE(result, true);
}
How to I test that the value 192 was actually passed to setValue() ? Also can I use ASSERT_WAS_CALLED to test the ObjectQuality constructor, istead of using my setValue method?
Regards,
James