All of the expectation objects share a similar approach: setting up a set of expectations at the beginning of a test and compare with actual values while the test is running.
For that reason each of the different expectation classes has at least
Additionally there are some methods to influence the verification process under certain circumstances:
Attention | |
---|---|
Please understand that this is different from not setting any expectations! Not setting an expectation yields in no error at all for any setting of an actual value since there is no value to compare with. |
The most common application is the use of ExpectationValue which does an exact comparision. Your own data types should implement a meaningful operator==() to be usable with mockpp. The following example creates an expectation value for int values.
ExpectationValue <int> ev ("verifyValue", 0); ev.setExpected(1234); ev.setActual(4321);