예제 #1
0
 @Test
 public void should_get_the_remaining_time() {
   input.ping(leo);
   TimeMachine.goTo(new DateTime().plusSeconds(5))
       .andExecute(
           new Block<Void>() {
             @Override
             public Void run() {
               assertEquals(10, input.getRemainingTime(leo));
               return null;
             }
           });
 }
예제 #2
0
 @Test
 public void should_allow_if_after_15_secconds() {
   input.ping(leo);
   TimeMachine.goTo(new DateTime().plusSeconds(16))
       .andExecute(
           new Block<Void>() {
             @Override
             public Void run() {
               assertTrue(input.can(leo));
               return null;
             }
           });
 }
예제 #3
0
 @Test
 public void should_not_allow_if_before_15_secconds() {
   input.ping(leo);
   assertFalse(input.can(leo));
 }