|
@ -27,7 +27,7 @@ class MenuManagerTest { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void testSelectFunction() { |
|
|
|
|
|
|
|
|
void select() { |
|
|
assertNull(mm.getCurrentMenu()); |
|
|
assertNull(mm.getCurrentMenu()); |
|
|
mm.select(0); |
|
|
mm.select(0); |
|
|
assertEquals(mm.getCurrentMenu().getName(), "Menu1"); |
|
|
assertEquals(mm.getCurrentMenu().getName(), "Menu1"); |
|
@ -36,14 +36,14 @@ class MenuManagerTest { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void testIsRootMenuFunction() { |
|
|
|
|
|
|
|
|
void inRootMenu() { |
|
|
assertTrue(mm.inRootMenu()); |
|
|
assertTrue(mm.inRootMenu()); |
|
|
mm.select(0); |
|
|
mm.select(0); |
|
|
assertFalse(mm.inRootMenu()); |
|
|
assertFalse(mm.inRootMenu()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void testBackFunction() { |
|
|
|
|
|
|
|
|
void back() { |
|
|
try { |
|
|
try { |
|
|
mm.back(); |
|
|
mm.back(); |
|
|
Assertions.fail("Test failed: shouldn't be able to go back in rootMenu"); |
|
|
Assertions.fail("Test failed: shouldn't be able to go back in rootMenu"); |
|
|