예제 #1
0
 @Test
 public void meanOfLargerSequence() {
   Statistician s = new Statistician();
   s.nextNumber(2.0);
   s.nextNumber(2.0);
   s.nextNumber(2.0);
   assertEquals(2.0, s.getMean(), 0.0001);
 }
예제 #2
0
 @Test
 public void meanOfSmallSequence() {
   Statistician s = new Statistician();
   s.nextNumber(1.1);
   assertEquals(1.1, s.getMean(), 0.0001);
 }
예제 #3
0
 @Test
 public void meanOfAnEmptySequence() {
   Statistician s = new Statistician();
   assertEquals(Double.NaN, s.getMean(), 0.0001);
 }