mirror of
https://github.com/praktimarc/kst4contest.git
synced 2026-08-24 19:17:07 +02:00
Changed sked opportunity highlighting mechanism to more precision, updated the manual
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package kst4contest.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class ChatMemberDirectionOpportunityTest {
|
||||
|
||||
@Test
|
||||
void directionalOpportunityExpiresAfterConfiguredValidityPeriod() {
|
||||
ChatMember member = new ChatMember();
|
||||
|
||||
member.setInAngleAndRange(true);
|
||||
long afterActivationEpochMs = System.currentTimeMillis();
|
||||
|
||||
assertTrue(member.isInAngleAndRangeAt(afterActivationEpochMs));
|
||||
assertFalse(member.isInAngleAndRangeAt(
|
||||
afterActivationEpochMs
|
||||
+ ChatMember.DIRECTION_OPPORTUNITY_VALIDITY_MILLIS
|
||||
+ 1L));
|
||||
}
|
||||
|
||||
@Test
|
||||
void directionalOpportunityCanBeClearedImmediately() {
|
||||
ChatMember member = new ChatMember();
|
||||
|
||||
member.setInAngleAndRange(true);
|
||||
assertTrue(member.isInAngleAndRange());
|
||||
|
||||
member.setInAngleAndRange(false);
|
||||
assertFalse(member.isInAngleAndRange());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user