Fixed bug with slot limitation in picker

This commit is contained in:
Andrey Terentev 2024-01-12 15:29:24 +07:00
parent 5725a40329
commit 45e777eb18
2 changed files with 1 additions and 2 deletions

View File

@ -19,7 +19,7 @@ public interface ItemWrapper<ITEM> {
}
default boolean canAddUnits(int amount) {
return maxUnits() == SlotLimit.UNLIMITED_VALUE || countUnits() + amount < maxUnits();
return maxUnits() == SlotLimit.UNLIMITED_VALUE || countUnits() + amount <= maxUnits();
}
ITEM getItem();

View File

@ -39,7 +39,6 @@ public class RoundRobinTests {
var slots = room.getSlots();
var users = userRepository.usersOf(room);
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());
}