public void TestFunctionEvaluationCounter() { int maxeval = 2; EndCriteria ec = new EndCriteria(100, 1e-8, maxeval, 100); Assert.AreEqual(ec.maxFunctionEvaluation, maxeval); ec.functionEvaluationCounter++; Assert.IsTrue(!ec.CheckFunctionEvaluations()); Assert.AreEqual(ec.Criteria, EndCriteria.CriteriaType.None); ec.functionEvaluationCounter++; Assert.IsTrue(ec.CheckFunctionEvaluations()); Assert.AreEqual(ec.Criteria, EndCriteria.CriteriaType.MaximumFunctionEvaluation); ec.Reset(); Assert.AreEqual(ec.functionEvaluationCounter, 0); Assert.IsTrue(!ec.CheckFunctionEvaluations()); Assert.AreEqual(ec.Criteria, EndCriteria.CriteriaType.None); }