mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 12:03:58 +00:00
extended test cases for CompetitorProviderFromRaceColumnsAndRegattaLike
This commit is contained in:
1 parent
4a82b228fb
commit
1ff1773760
1 file changed
+38
-1
+38
-1
@@ -70,10 +70,11 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
compLists[l].add(createCompetitor("" + l + "/" + i));
|
||||
}
|
||||
}
|
||||
competitorProviderRegattaLeaderboard = new CompetitorProviderFromRaceColumnsAndRegattaLike(regattaLeaderboard);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleCompetitorListOnOneRace() {
|
||||
public void testSimpleCompetitorListOnOneRaceInFlexibleLeaderboard() {
|
||||
TrackedRace trackedRace = new MockedTrackedRaceWithStartTimeAndRanks(MillisecondsTimePoint.now(), compLists[0]);
|
||||
flexibleLeaderboard.addRace(trackedRace, "R1", /* medalRace */ false);
|
||||
Set<Competitor> expected = new HashSet<>(compLists[0]);
|
||||
@@ -81,4 +82,40 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
Util.addAll(competitorProviderFlexibleLeaderboard.getAllCompetitors(), actual);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTwoCompetitorListsOnTwoRacesInFlexibleLeaderboard() {
|
||||
TrackedRace trackedRace1 = new MockedTrackedRaceWithStartTimeAndRanks(MillisecondsTimePoint.now(), compLists[0]);
|
||||
flexibleLeaderboard.addRace(trackedRace1, "R1", /* medalRace */ false);
|
||||
TrackedRace trackedRace2 = new MockedTrackedRaceWithStartTimeAndRanks(MillisecondsTimePoint.now(), compLists[1]);
|
||||
flexibleLeaderboard.addRace(trackedRace2, "R2", /* medalRace */ false);
|
||||
Set<Competitor> expected = new HashSet<>(compLists[0]);
|
||||
expected.addAll(compLists[1]);
|
||||
Set<Competitor> actual = new HashSet<>();
|
||||
Util.addAll(competitorProviderFlexibleLeaderboard.getAllCompetitors(), actual);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleCompetitorListOnOneRaceInRegattaLeaderboard() {
|
||||
TrackedRace trackedRace = new MockedTrackedRaceWithStartTimeAndRanks(MillisecondsTimePoint.now(), compLists[0]);
|
||||
regattaLeaderboard.getRaceColumnByName("R1").setTrackedRace(regattaLeaderboard.getRaceColumnByName("R1").getFleetByName("Yellow"), trackedRace);
|
||||
Set<Competitor> expected = new HashSet<>(compLists[0]);
|
||||
Set<Competitor> actual = new HashSet<>();
|
||||
Util.addAll(competitorProviderRegattaLeaderboard.getAllCompetitors(), actual);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTwoCompetitorListsOnTwoRacesInRegattaLeaderboard() {
|
||||
TrackedRace trackedRace1 = new MockedTrackedRaceWithStartTimeAndRanks(MillisecondsTimePoint.now(), compLists[0]);
|
||||
regattaLeaderboard.getRaceColumnByName("R1").setTrackedRace(regattaLeaderboard.getRaceColumnByName("R1").getFleetByName("Yellow"), trackedRace1);
|
||||
TrackedRace trackedRace2 = new MockedTrackedRaceWithStartTimeAndRanks(MillisecondsTimePoint.now(), compLists[1]);
|
||||
regattaLeaderboard.getRaceColumnByName("R1").setTrackedRace(regattaLeaderboard.getRaceColumnByName("R1").getFleetByName("Blue"), trackedRace2);
|
||||
Set<Competitor> expected = new HashSet<>(compLists[0]);
|
||||
expected.addAll(compLists[1]);
|
||||
Set<Competitor> actual = new HashSet<>();
|
||||
Util.addAll(competitorProviderRegattaLeaderboard.getAllCompetitors(), actual);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user