private DeepEqualsNode(
     DeepEqualsNode parent,
     FieldInfo parentField,
     ICompared expected,
     ICompared actual,
     List<ComparedPair> compared)
     : this(expected, actual, compared)
 {
     this.Parent = parent;
     this.ParentField = parentField;
 }
 private DeepEqualsNode(
     DeepEqualsNode parent,
     FieldInfo parentField,
     ICompared expected,
     ICompared actual,
     List <ComparedPair> compared)
     : this(expected, actual, compared)
 {
     this.Parent      = parent;
     this.ParentField = parentField;
 }
 private DeepEqualsNode(ICompared expected, ICompared actual, List<ComparedPair> compared)
 {
     this.Expected = expected;
     this.Actual = actual;
     this.compared = compared;
     var expectedType = this.Expected.Value?.GetType();
     var actualType = this.Actual.Value?.GetType();
     this.Type = expectedType == actualType ? expectedType : null;
     this.Fields = this.Type?.GetFields(BindingFlags.Instance |
                                        BindingFlags.Public |
                                        BindingFlags.NonPublic |
                                        BindingFlags.FlattenHierarchy)
                              ?? new FieldInfo[0];
 }
        private DeepEqualsNode(ICompared expected, ICompared actual, List <ComparedPair> compared)
        {
            this.Expected = expected;
            this.Actual   = actual;
            this.compared = compared;
            var expectedType = this.Expected.Value?.GetType();
            var actualType   = this.Actual.Value?.GetType();

            this.Type   = expectedType == actualType ? expectedType : null;
            this.Fields = this.Type?.GetFields(BindingFlags.Instance |
                                               BindingFlags.Public |
                                               BindingFlags.NonPublic |
                                               BindingFlags.FlattenHierarchy)
                          ?? new FieldInfo[0];
        }
        private static string GetValue(ICompared compared)
        {
            var value = compared.Value;

            if (value == null)
            {
                return("null");
            }

            var type = value.GetType();

            if (type.IsEquatable())
            {
                return(value.ToString());
            }

            return(type.Name);
        }
        private static string GetValue(ICompared compared)
        {
            var value = compared.Value;
            if (value == null)
            {
                return "null";
            }

            var type = value.GetType();
            if (type.IsEquatable())
            {
                return value.ToString();
            }

            return type.Name;
        }