예제 #1
0
        public void JaggedArrayParseErrors(string x, string y)
        {
            var comparer = new JacobianComparison(defaultTolerance);

            comparer.CompareFiles(x, y);
            Assert.True(comparer.ViolationsHappened());
            Assert.True(comparer.ParseError);
        }
예제 #2
0
        public void FarJaggedArraysFail(string x, string y, int expectedComparisons, double tolerance)
        {
            var comparer = new JacobianComparison(tolerance);

            comparer.CompareFiles(x, y);
            Assert.True(comparer.ViolationsHappened());
            Assert.False(comparer.ParseError);
            Assert.False(comparer.DimensionMismatch);
            Assert.False(comparer.MaxDifference <= tolerance);
            Assert.True(comparer.DifferenceViolationCount > 0);
            Assert.Equal(expectedComparisons, comparer.NumberComparisonCount);
            Assert.NotEmpty(comparer.DifferenceViolations);
        }
예제 #3
0
        public void FarJaggedArraysViolationPositions()
        {
            var comparer = new JacobianComparison(defaultTolerance);

            comparer.CompareFiles(jaggedExtraWhitespace, jaggedErrors);
            Assert.True(comparer.ViolationsHappened());
            Assert.False(comparer.ParseError);
            Assert.False(comparer.DimensionMismatch);
            Assert.False(comparer.MaxDifference <= defaultTolerance);
            Assert.Equal(8, comparer.DifferenceViolationCount);
            Assert.Equal(15, comparer.NumberComparisonCount);
            Assert.NotEmpty(comparer.DifferenceViolations);
            var expectedViolations = new[] { (0, 0), (1, 1), (3, 1), (0, 2), (2, 2), (0, 3), (2, 3), (4, 3) };
예제 #4
0
        public void NearJaggedArraysPass(string x, string y, int expectedComparisons)
        {
            var comparer = new JacobianComparison(defaultTolerance);

            comparer.CompareFiles(x, y);
            Assert.False(comparer.ViolationsHappened());
            Assert.False(comparer.ParseError);
            Assert.False(comparer.DimensionMismatch);
            Assert.True(comparer.MaxDifference <= defaultTolerance);
            Assert.Equal(0, comparer.DifferenceViolationCount);
            Assert.Equal(expectedComparisons, comparer.NumberComparisonCount);
            Assert.Empty(comparer.DifferenceViolations);
        }