package lab.art; import static org.junit.Assert.*; import java.util.Random; import org.junit.Test; public class AverageOperatorTester { @Test public void testConstructor() { new AverageOperator(); } @Test public void testOperation() { Random random = new Random(System.currentTimeMillis()); AverageOperator operator = new AverageOperator(); int NUMBER = 1000; double DELTA = 0.0001; for (int n = 0; n < NUMBER; n++) { double a = random.nextDouble(); double b = random.nextDouble(); assertEquals("operation method failed", (a + b) / 2, operator.operation(a, b), DELTA); } } }