문제

How can I do an OR operation when specifying my expectations ? The arguments can either be 10 or 11.

public void testGetRandom() {
    context.checking(new Expectations() {{
        oneOf (myrandom).isSpecific(10)  **OR** oneOf (myrandom).isSpecific(11);
    }});

    context.assertIsSatisfied();
}
도움이 되었습니까?

해결책

you want to use argument matches - last one

example (untested):

oneOf (myrandom).isSpecific(with(anyOf(10,11)));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top