开发者

Using normal mock and NiceMock within the same mockControl

开发者 https://www.devze.com 2023-01-21 02:46 出处:网络
Is it possible to use a niceMock and a \"normal\" mock within the same mockControl object? Currently if I try to set one of the mock to nice

Is it possible to use a niceMock and a "normal" mock within the same mockControl object?

Currently if I try to set one of the mock to nice

someMock = mockControl.createMock(someClass.class);
EasyMock.resetToNice(开发者_开发问答someMock);

It seems to reset the entire control to nice

So i would like a way to have different mock type in the same control.

Thank you


It is not possible. However, you can always record method calls asStub to have a nice behavior on a default mock.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号