Cleaning up


Usually you will want the faked behavior you set to be per test method.
In order to do that you should use the ISOLATOR_CLEANUP macro
#define ISOLATOR_CLEANUP ( )

Cleans Isolator++ fakes at the end of the test.

Remarks:
Use ISOLATOR_CLEANUP macro at the end of the test to clean up any faked behavior you set in the test. Note that if you will not do that the faked behavior will carry on to the next test. Example:
WHEN_CALLED(fakeConcrete->GetString()).Return("hello");
 ASSERT_EQ("hello", fakeConcrete->GetString());
 ISOLATOR_CLEANUP()
 
 

 

See also: