Exemple #1
0
        private void CompareInterfaces()
        {
            IEnumerable <string> referenceInterfaces = ReferenceType.GetInterfaces().Select(@interface => @interface.GetCompareableName()).ToList();
            IEnumerable <string> newInterfaces       = NewType.GetInterfaces().Select(@interface => @interface.GetCompareableName()).ToList();

            // missing interfaces
            foreach (string @interface in referenceInterfaces.Except(newInterfaces))
            {
                ComparerResult.AddRemovedItem(ResultContext.Interface, @interface, Severity.Error);
            }

            // new interfaces
            foreach (string @interface in newInterfaces.Except(referenceInterfaces))
            {
                ComparerResult.AddAddedItem(ResultContext.Interface, @interface, Severity.Warning);
            }
        }