Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在指定我的期望时如何进行 OR 操作?参数可以是 10 或 11。
public void testGetRandom() { context.checking(new Expectations() {{ oneOf (myrandom).isSpecific(10) **OR** oneOf (myrandom).isSpecific(11); }}); context.assertIsSatisfied(); }
你想使用参数匹配- 最后一个
示例(未经测试):
oneOf (myrandom).isSpecific(with(anyOf(10,11)));