Faking members and local variables
|Top Previous Next|
When you have object members in your class that are created within the class and you need to set their behavior you can use FAKE_ALL API as well.
Let's look at a similar code sample but this time the address member is not a pointer.
As before, we create a fake Address handle, and we can set behavior for all current Address object.
The test still looks the same:
Similarly, if your method under-test creates a local variable during it's run, use FAKE_ALL API to set it's behavior:
And the test set up might look like this:
Copyright © Typemock Ltd. 2009-2020. All Rights Reserved.