Exemple #1
0
        protected ComparerResult CompareStrings(string x, string y, TextTolerance tolerance)
        {
            var distance = tolerance.Implementation.Invoke(x, y);

            if (tolerance.Predicate.Invoke(distance, tolerance.Value))
            {
                return(ComparerResult.Equality);
            }
            else
            {
                return(new ComparerResult(distance.ToString()));
            }
        }
Exemple #2
0
 protected ComparerResult CompareObjects(object x, object y, TextTolerance tolerance)
 {
     return(CompareStrings(x as string, y as string, tolerance));
 }