Fixed bug with slot limitation in picker
This commit is contained in:
parent
5725a40329
commit
45e777eb18
@ -19,7 +19,7 @@ public interface ItemWrapper<ITEM> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default boolean canAddUnits(int amount) {
|
default boolean canAddUnits(int amount) {
|
||||||
return maxUnits() == SlotLimit.UNLIMITED_VALUE || countUnits() + amount < maxUnits();
|
return maxUnits() == SlotLimit.UNLIMITED_VALUE || countUnits() + amount <= maxUnits();
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM getItem();
|
ITEM getItem();
|
||||||
|
|||||||
@ -39,7 +39,6 @@ public class RoundRobinTests {
|
|||||||
var slots = room.getSlots();
|
var slots = room.getSlots();
|
||||||
var users = userRepository.usersOf(room);
|
var users = userRepository.usersOf(room);
|
||||||
Assertions.assertTrue(slots.isUnlimited() || slots.getSlots() >= users.size()); // check slots limitation
|
Assertions.assertTrue(slots.isUnlimited() || slots.getSlots() >= users.size()); // check slots limitation
|
||||||
System.out.printf("%s/%s%n", users.size(), slots.getSlots());
|
|
||||||
|
|
||||||
Assertions.assertEquals("room-2-0", room.getId());
|
Assertions.assertEquals("room-2-0", room.getId());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user