private DifferenceWhenComparingCoordinateValues ShowDifferenceIfSignificant( string lineFromFileWithRegressionResults, string lineFromFileWithRegressionResults2, double deltaValueForDifferencesToIgnore, bool shouldAlsoDisplayDifferencesWhenValueIsMissing ) { TestResultItem t1 = new TestResultItem(lineFromFileWithRegressionResults); TestResultItem t2 = new TestResultItem(lineFromFileWithRegressionResults2); DifferenceWhenComparingCoordinateValues diff = t1.IsDeltaDifferenceSignificant(t2, deltaValueForDifferencesToIgnore); if ( (shouldAlsoDisplayDifferencesWhenValueIsMissing && ( diff == DifferenceWhenComparingCoordinateValues.SIGNIFICANT_VALUE_DIFFERENCE || diff == DifferenceWhenComparingCoordinateValues.EXISTING_VS_NOT_EXISTING ) ) || (!shouldAlsoDisplayDifferencesWhenValueIsMissing && ( diff == DifferenceWhenComparingCoordinateValues.SIGNIFICANT_VALUE_DIFFERENCE ) ) ) { Console.WriteLine("Diff lines with significant delta " + deltaValueForDifferencesToIgnore + " : "); Console.WriteLine(lineFromFileWithRegressionResults); Console.WriteLine(lineFromFileWithRegressionResults2); } return(diff); }
public void ShowDifferenceIfSignificantTest() { DifferenceWhenComparingCoordinateValues differenceWhenComparingCoordinateValues = ShowDifferenceIfSignificant( "35.00827072383671|31.517029225386523|2039|200816.30213267874|602774.2381723676|35.00827072137521|31.517029283149466", "35.00827072383671|31.517029225386523|2039|200816.30213267755|602774.2381723677|35.00827072137521|31.517029283149473", deltaValueForDifferencesToIgnoreWhenComparingDifferentVersionForSameImplementation, true // shouldAlsoDisplayDifferencesWhenValueIsMissing ); if (differenceWhenComparingCoordinateValues != DifferenceWhenComparingCoordinateValues.SIGNIFICANT_VALUE_DIFFERENCE) { // Console.WriteLine("no significant differenceWhenComparingCoordinateValues"); } Assert.AreNotEqual( differenceWhenComparingCoordinateValues, DifferenceWhenComparingCoordinateValues.SIGNIFICANT_VALUE_DIFFERENCE ); }
public ISet <int> GetIndexesForRowsWithSignificantDifference( FileWithRows that, double deltaValueForDifferencesToIgnore ) { ISet <int> indexes = new HashSet <int>(); for (int fileRowIndex = 0; fileRowIndex < rowsFromFile.Count; fileRowIndex++) { string thisRow = this.rowsFromFile[fileRowIndex]; string thatRow = that.rowsFromFile[fileRowIndex]; TestResultItem t1 = new TestResultItem(thisRow); TestResultItem t2 = new TestResultItem(thatRow); DifferenceWhenComparingCoordinateValues diff = t1.IsDeltaDifferenceSignificant(t2, deltaValueForDifferencesToIgnore); if (diff == DifferenceWhenComparingCoordinateValues.SIGNIFICANT_VALUE_DIFFERENCE) { indexes.Add(fileRowIndex); } } return(indexes); }