문제

I'm running the assertThat() method in the FEST library. But don't understand the runtime behaviour for the code below which runs in a while loop.

assertThat(Priority >= nextPriority);

At runtime Priority = 1 and nextPriority = 2, but when I debug this statement the method, the method doesn't exit but continues to the next line within the while loop.

Does anyone know why this happenns?

도움이 되었습니까?

해결책

assertThat() doesn't verify any assertion. What you want is

assertThat(priority >= nextPriority).isTrue();

or better:

assertThat(priority).isGreaterThanOrEqualTo(nextPriority);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top