|
|
@ -29,8 +29,18 @@ class MenuManagerTest { |
|
|
|
@Test |
|
|
|
void select() { |
|
|
|
assertNull(mm.getCurrentMenu()); |
|
|
|
//Negative index |
|
|
|
mm.select(-1); |
|
|
|
assertNull(mm.getCurrentMenu()); |
|
|
|
|
|
|
|
mm.select(0); |
|
|
|
assertEquals(mm.getCurrentMenu().getName(), "Menu1"); |
|
|
|
//Dose nothing when index to big |
|
|
|
mm.select(1); |
|
|
|
assertEquals(mm.getCurrentMenu().getName(), "Menu1"); |
|
|
|
|
|
|
|
mm.select(0); |
|
|
|
assertEquals(mm.getCurrentMenu().getName(), "Menu1.1"); |
|
|
|
mm.select(0); |
|
|
|
assertEquals(mm.getCurrentMenu().getName(), "Menu1.1"); |
|
|
|
} |
|
|
|