/* DayDataTest.java 1.0 1 December 2002 * by Viera K. Proux * modified by S. Tuttle, 4 February 2003 */ public class DayDataTest extends JPFalt { public static void main(String[] args) { new DayDataTest(); } /** Test suite for the class DayData */ /*------------------------------------------------------------------------- Define a DayData object and print the member data values. (again, this particular class did not have simple accessor methods, or I would have tested them here as in the in-class Person example) -------------------------------------------------------------------------*/ void TestDayData() { println("\nDefine DayData objects, print member data values"); println(new DayData( new WeatherData(20, 56, 0.4), new WeatherData(15, 58, 0.2), new WeatherData(10, 83, 1.2))); println(new DayData( new WeatherData(22, 46, 0.1), new WeatherData(14, 58, 0.3), new WeatherData(9, 79, 1.4))); } /*------------------------------------------------------------------------- Test the withinNorm() method -------------------------------------------------------------------------*/ void TestWithinNorm() { testHeader("withinNorm()"); /*--------------------------------------------------------------------- Define two DayData objects. ---------------------------------------------------------------------*/ DayData today = new DayData( new WeatherData(20, 56, 0.4), new WeatherData(15, 58, 0.2), new WeatherData(10, 83, 1.2)); DayData yesterday = new DayData( new WeatherData(11, 46, 0.1), new WeatherData(12, 58, 0.3), new WeatherData(10, 79, 1.4)); expected(true); actual( today.withinNorm()); expected(false); actual( yesterday.withinNorm()); } /*------------------------------------------------------------------------- Test the mean() method -------------------------------------------------------------------------*/ void TestMean() { testHeader("mean()"); /*--------------------------------------------------------------------- ??????????????????????????????? ---------------------------------------------------------------------*/ } /* ?????????????????????????? */ /*--------------------------------------------------------------------- End of test suite for class DayData ---------------------------------------------------------------------*/ }