Example #1
0
        protected override ComparerResult CompareObjects(object x, object y)
        {
            var xThreeState = caster.Execute(x);
            var yThreeState = caster.Execute(y);

            if (IsEqual(xThreeState, yThreeState))
            {
                return(ComparerResult.Equality);
            }

            return(new ComparerResult(x.ToString()));
        }
Example #2
0
        protected override ComparerResult CompareObjects(object x, object y)
        {
            var builder = new NumericIntervalBuilder(x);

            builder.Build();
            if (builder.IsValid())
            {
                return(CompareDecimals
                       (
                           builder.GetInterval()
                           , caster.Execute(y)
                       ));
            }

            builder = new NumericIntervalBuilder(y);
            builder.Build();
            if (builder.IsValid())
            {
                return(CompareDecimals
                       (
                           builder.GetInterval()
                           , caster.Execute(x)
                       ));
            }

            return(CompareObjects(x, y, NumericAbsoluteTolerance.None));
        }
Example #3
0
        protected override ComparerResult CompareObjects(object x, object y)
        {
            var rxDateTime = caster.Execute(x);
            var ryDateTime = caster.Execute(y);

            //Compare DateTimes (without tolerance)
            if (IsEqual(rxDateTime, ryDateTime))
            {
                return(ComparerResult.Equality);
            }

            return(new ComparerResult(rxDateTime.ToString(DateTimeFormatInfo.InvariantInfo)));
        }