@Test public void testSummaryStatistics() { double arr[] = {3.0, 10.2, -20.4, -1.0, -5.3, 1.0, -5.1}; TemperatureSeriesAnalysis tsa = new TemperatureSeriesAnalysis(arr); TempSummaryStatistics tss = tsa.summaryStatistics(); double average = tsa.average(); assertEquals(average, tss.getAvgTemp(), 0.001); }
@Test public void testTemperatureSeriesAnalysis() { TemperatureSeriesAnalysis temperatureSeriesAnalysis = new TemperatureSeriesAnalysis(); TempSummaryStatistics tss = temperatureSeriesAnalysis.summaryStatistics(); assertTrue( tss.getAvgTemp() == tss.getMinTemp() && tss.getAvgTemp() == tss.getMaxTemp() && tss.getAvgTemp() == tss.getDevTemp()); }