示例#1
0
 @Test
 public void testAddObserver() {
   Timer timer = new SimpleTimer();
   MockSimpleTimer observer = new MockSimpleTimer();
   timer.addTimeObserver(observer);
   timer.timeChanged();
   assertEquals(1, observer.myTime);
 }
示例#2
0
 @Test
 public void testInitialization() {
   Timer timer = new SimpleTimer();
   assertEquals(0, timer.getRound());
 }