diff --git a/test/eva2/problems/F23ProblemTest.java b/test/eva2/problems/F23ProblemTest.java new file mode 100644 index 00000000..fa2b5eb2 --- /dev/null +++ b/test/eva2/problems/F23ProblemTest.java @@ -0,0 +1,24 @@ +package eva2.problems; + +import eva2.tools.math.Mathematics; +import junit.framework.TestCase; + +public class F23ProblemTest extends TestCase { + + /** + * The Generalized Schaffer function has its minimum + * at x_{i} = 0 + * + * @throws Exception + */ + public void testEvaluate() throws Exception { + F23Problem problem = new F23Problem(); + + for (int i = 1; i < 100; i++) { + double[] x = Mathematics.zeroes(i); + double[] res = problem.evaluate(x); + assertEquals(1, res.length); + assertEquals(0.0, res[0]); + } + } +} \ No newline at end of file