Esempio n. 1
0
        /// <summary>
        /// Creates an instance of the ObjectComparer class.
        /// </summary>
        /// <param name="factory">An ObjectGraphFactory to use for
        /// converting objects to graphs.</param>
        public ObjectComparer(ObjectGraphFactory factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            this.objectGraphFactory = factory;
        }
Esempio n. 2
0
        public ObjectComparer(ObjectGraphFactory factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            ObjectGraphFactory                 = factory;
            _typePropertiesToIgnore            = new List <MemberInfo>();
            _instancePropertiesToIgnore        = new Dictionary <object, List <MemberInfo> >();
            _customTypePropertyComparisons     = new List <PropertyComparator>();
            _customInstancePropertyComparisons = new Dictionary <object, List <PropertyComparator> >();
        }
        public ObjectComparer(ObjectGraphFactory factory)
        {
            if (factory == null)
                throw new ArgumentNullException("factory");

            ObjectGraphFactory = factory;
            _typePropertiesToIgnore = new List<MemberInfo>();
            _instancePropertiesToIgnore = new Dictionary<object, List<MemberInfo>>();
            _customTypePropertyComparisons = new List<PropertyComparator>();
            _customInstancePropertyComparisons = new Dictionary<object, List<PropertyComparator>>();
        }
 private static void ObjectToConsole(object value, ObjectGraphFactory factory)
 {
     GraphNode root = factory.CreateObjectGraph(value);
     Console.WriteLine(StringFromGraph(root));
 }