예제 #1
0
 @Test
 public void testToggle() {
   key.toggle(true);
   assertTrue(key.isDown());
   key.toggle(false);
   assertFalse(key.isDown());
 }
예제 #2
0
 @Test
 public void testSetDown() {
   key.setDown(true);
   assertTrue(key.isDown());
   key.setDown(false);
   assertFalse(key.isDown());
 }
예제 #3
0
 @Test
 public void testClicking() {
   key.toggle(true);
   assertFalse(key.isClicked());
   key.tick();
   assertTrue(key.isClicked());
   key.tick();
   assertFalse(key.isClicked());
   key.toggle(false);
   assertFalse(key.isClicked());
   key.toggle(true);
   assertFalse(key.isClicked());
   key.tick();
   assertTrue(key.isClicked());
   key.tick();
   assertFalse(key.isClicked());
 }
예제 #4
0
 @Test
 public void testInitialState() {
   assertFalse(key.isDown());
   assertFalse(key.isClicked());
 }
예제 #5
0
 @Before
 public void setUp() {
   key = InputKey.UP;
   key.reset();
 }