Exemplo n.º 1
0
 @Test
 public void advanceTimeTest() {
   Logger logger = new Logger(3, new ImmutableClock(0, 0));
   observer.attachLogger(logger);
   observer.advanceTime(new ImmutableClock(1, 100));
   assertEquals(new ImmutableClock(1, 100), logger.getCurrentTime());
 }
Exemplo n.º 2
0
 @Test
 public void startNewDayTest() {
   Logger logger = new Logger(3, new ImmutableClock(0, 0));
   observer.attachLogger(logger);
   observer.startNewDay(new ImmutableClock(1, 0));
   assertEquals(new ImmutableClock(1, 0), logger.getCurrentTime());
   assertNotNull(logger.getDetailedDays());
 }
Exemplo n.º 3
0
 @Test(expected = IllegalArgumentException.class)
 public void startIllegalDay() {
   observer.startNewDay(null);
 }
Exemplo n.º 4
0
 @Test(expected = IllegalArgumentException.class)
 public void advanceIllegalTime() {
   observer.advanceTime(null);
 }
Exemplo n.º 5
0
 @Test(expected = IllegalArgumentException.class)
 public void detachLoggerTest2() {
   observer.detachLogger(null);
 }
Exemplo n.º 6
0
 @Test
 public void detachLoggerTest1() {
   Logger logger = new Logger(3, new ImmutableClock(0, 0));
   observer.attachLogger(logger);
   observer.detachLogger(logger);
 }