Ask Your Question
1

Can the behavior of a mock object be altered by repeatedly recreating it?

asked 2023-05-10 20:31:56 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-10 20:45:01 +0000

ladyg gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-10 20:31:56 +0000

Seen: 9 times

Last updated: May 10 '23