Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, the behavior of a mock object can be altered by repeatedly recreating it. This is because each time the mock object is recreated, it starts with its default behavior unless you explicitly set a new behavior. Therefore, if you want to change the behavior of a mock object, you can create a new one with the desired behavior. However, it is important to note that recreating the mock object multiple times may lead to unnecessary overhead and should be done judiciously.