public void TestOutput_RelativeTolerances(bool treatNullsAsZero, double relativeTolerance, double?expected, double?actual, double?difference)
        {
            var plugin = new DoubleComparerPlugin
            {
                RelativeTolerance        = relativeTolerance,
                ToleranceModes           = FloatingPointToleranceModes.RelativeTolerance,
                TreatMissingValuesAsZero = treatNullsAsZero
            };

            this.PerformTest(plugin, expected, actual, difference);
            this.PerformTest(plugin, actual, expected, difference.HasValue ? (double?)(0 - difference.Value) : null);
        }
        private void PerformTest(DoubleComparerPlugin plugin, double?expected, double?actual, double?difference)
        {
            var output = plugin.TryCompare("key",
                                           expected.HasValue ? (object)expected.Value : null,
                                           actual.HasValue ? (object)actual.Value : null);

            if (difference.HasValue)
            {
                Assert.Equal(ComparisonResultType.Different, output.ComparisonResultType);
                Assert.Equal(difference.Value, output.Payload);
            }
            else
            {
                Assert.Equal(ComparisonResultType.Equal, output.ComparisonResultType);
            }
        }