コード例 #1
0
  @Test
  public void lastNumberOfSmallSequence() {
    Statistician s = new Statistician();
    s.nextNumber(1.1);

    assertEquals(1.1, s.getLastNumberOfSequence(), 0.0001);
  }
コード例 #2
0
  @Test
  public void lastNumberOfLargerSequence() {
    Statistician s = new Statistician();
    s.nextNumber(1.1);
    s.nextNumber(5.1);
    s.nextNumber(5.0);

    assertEquals(5.0, s.getLastNumberOfSequence(), 0.0001);
  }
コード例 #3
0
 @Test
 public void lastNumberOfAnEmptySequence() {
   Statistician s = new Statistician();
   assertEquals(Double.NaN, s.getLastNumberOfSequence(), 0.0001);
 }