public void ParameterRangeTest()
{
LbfgsbComparer[] tests =
{
new LbfgsbComparer() { m = -1 },
new LbfgsbComparer() { factr = -1 },
new LbfgsbComparer() { max_iterations = -1 },
new LbfgsbComparer() { pgtol = -1 },
};
var problem = problems[0];
for (int i = 0; i < tests.Length; i++)
{
var test = tests[i];
string actual = String.Empty;
string expected = String.Empty;
try { test.Actual(problem); }
catch (Exception ex)
{
actual = ex.Data["Code"] as string;
if (actual == null)
throw;
}
test.Expected(problem);
expected = test.NativeCode;
if (actual == String.Empty)
actual = test.ActualMessage;
Assert.AreEqual(expected, actual);
Assert.AreNotEqual(String.Empty, actual);
}
}