Changeset 4237 for branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 08/17/10 08:07:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicSimplifierTest.cs
r4236 r4237 51 51 52 52 { 53 SymbolicRegressionSolution solution = LoadSolution("RegressionSolution01.hl"); 53 SymbolicRegressionSolution solution = LoadSolution("RegressionSolution01.hl"); 54 54 SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution); 55 55 AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues); … … 83 83 84 84 private SymbolicRegressionSolution LoadSolution(string fileName) { 85 var result = (Result)ContentManager.Load(fileName); 86 return (SymbolicRegressionSolution)result.Value; 85 var doc = ContentManager.Load(fileName); 86 Result result = doc as Result; 87 if (result != null) { 88 return (SymbolicRegressionSolution)result.Value; 89 } 90 SymbolicRegressionSolution solution = doc as SymbolicRegressionSolution; 91 if (solution != null) { 92 return solution; 93 } 94 Assert.Fail("Cannot load file " + fileName); 95 throw new AssertFailedException(); 87 96 } 88 97 … … 103 112 var actualEnumerator = actual.GetEnumerator(); 104 113 while (expectedEnumerator.MoveNext() & actualEnumerator.MoveNext()) { 105 Assert.AreEqual(expectedEnumerator.Current, actualEnumerator.Current, 1E-6 * expectedEnumerator.Current);114 Assert.AreEqual(expectedEnumerator.Current, actualEnumerator.Current, Math.Abs(1E-6 * expectedEnumerator.Current)); 106 115 } 107 116 if (expectedEnumerator.MoveNext() | actualEnumerator.MoveNext())
Note: See TracChangeset
for help on using the changeset viewer.