Beispiel #1
0
        public static ComparisonReport Report(Instance a, Instance b, ComparisonTypes comparisonTypes)
        {
            var messages = ComparisonMethods.
                           Where(c => comparisonTypes.HasFlag(c.Key)).
                           SelectMany(c => c.Value(a, b)).
                           ToList();

            return(new ComparisonReport(!messages.Any(), messages));
        }
Beispiel #2
0
        public static ComparisonReport Report(Instance a, Instance b, ComparisonTypes comparisonTypes, BasicComparisons basicComparisons)
        {
            var messages = new List <string>();

            if (comparisonTypes.HasFlag(ComparisonTypes.Basic))
            {
                messages.AddRange(BasicComparison(a, b, basicComparisons));
            }

            messages.AddRange(ComparisonMethods.
                              Where(c => comparisonTypes.HasFlag(c.Key)).
                              SelectMany(c => c.Value(a, b)));

            return(new ComparisonReport(!messages.Any(), messages));
        }