use of com.karuslabs.commons.graphics.windows.Window in project Karus-Commons by Pante.
the class ResettableComponentTest method reset.
@ParameterizedTest
@CsvSource({ "true, 1", "false, 0" })
void reset(boolean reset, int times) {
Window window = mock(Window.class);
InventoryCloseEvent event = mock(InventoryCloseEvent.class);
component.reset(reset);
component.reset(window, event);
assertEquals(reset, component.reset());
verify(component, times(times)).onReset(window, event);
}
use of com.karuslabs.commons.graphics.windows.Window in project Karus-Commons by Pante.
the class CheckBoxTest method reset.
@ParameterizedTest
@CsvSource({ "true, 1, false", "false, 0, true" })
void reset(boolean reset, int times, boolean expected) {
checkbox.checked = true;
checkbox.reset(reset);
Window window = mock(Window.class);
InventoryCloseEvent event = mock(InventoryCloseEvent.class);
checkbox.reset(window, event);
verify(event, times(times)).getInventory();
assertEquals(expected, checkbox.checked);
}
use of com.karuslabs.commons.graphics.windows.Window in project Karus-Commons by Pante.
the class AbstractRegionTest method open.
@Test
void open() {
Window window = mock(Window.class);
InventoryOpenEvent event = mock(InventoryOpenEvent.class);
region.open(window, event);
verify(region).onOpen(window, event);
verify(button).open(window, event);
}
use of com.karuslabs.commons.graphics.windows.Window in project Karus-Commons by Pante.
the class AbstractRegionTest method reset.
@ParameterizedTest
@CsvSource({ "true, 1", "false, 0" })
void reset(boolean reset, int times) {
Window window = mock(Window.class);
InventoryCloseEvent event = mock(InventoryCloseEvent.class);
region.reset(reset);
region.reset(window, event);
verify(event, times(times)).getInventory();
verify(button, times(times)).reset(window, event);
}
use of com.karuslabs.commons.graphics.windows.Window in project Karus-Commons by Pante.
the class AbstractRegionTest method close.
@Test
void close() {
Window window = mock(Window.class);
InventoryCloseEvent event = mock(InventoryCloseEvent.class);
region.close(window, event);
verify(region).onClose(window, event);
verify(button).close(window, event);
}
Aggregations