1 10 package org.jgap; 11 12 import junit.framework.*; 13 14 20 public final class DefaultFitnessEvaluatorTest 21 extends JGAPTestCase { 22 23 24 private final static String CVS_REVISION = "$Revision: 1.6 $"; 25 26 public static Test suite() { 27 TestSuite suite = new TestSuite(DefaultFitnessEvaluatorTest.class); 28 return suite; 29 } 30 31 public void testIsFitter_0() { 32 FitnessEvaluator evaluator = new DefaultFitnessEvaluator(); 33 assertEquals(true, evaluator.isFitter(1, 0)); 34 assertEquals(false, evaluator.isFitter(0, 1)); 35 } 36 37 public void testIsFitter_1() { 38 FitnessEvaluator evaluator = new DefaultFitnessEvaluator(); 39 assertEquals(true, evaluator.isFitter(12, 11)); 40 assertEquals(false, evaluator.isFitter(11, 12)); 41 } 42 43 public void testIsFitter_2() { 44 FitnessEvaluator evaluator = new DefaultFitnessEvaluator(); 45 assertEquals(false, evaluator.isFitter( -1, 1)); 46 assertEquals(true, evaluator.isFitter(1, -1)); 47 } 48 49 public void testIsFitter_3() { 50 FitnessEvaluator evaluator = new DefaultFitnessEvaluator(); 51 assertEquals(false, evaluator.isFitter(0, 0)); 52 } 53 54 public void testIsFitter_4() { 55 FitnessEvaluator evaluator = new DefaultFitnessEvaluator(); 56 assertEquals(false, evaluator.isFitter( -4, -4)); 57 } 58 59 public void testIsFitter_5() { 60 FitnessEvaluator evaluator = new DefaultFitnessEvaluator(); 61 assertEquals(false, evaluator.isFitter( -3, -1)); 62 assertEquals(true, evaluator.isFitter( -1, -3)); 63 } 64 } 65 | Popular Tags |