Exemplo n.º 1
0
        protected Difference(ObjectDifference parent, Type type, object expected, object result, string path)
        {
            Parent   = parent;
            Type     = type;
            Expected = expected;
            Result   = result;
            Path     = path;

            Parent?.Children.Add(this);
        }
Exemplo n.º 2
0
        private void InnerCollect(Type objectType, object expected, object result, ObjectDifference parent, string path)
        {
            if (TypeHelper.IsPrimitive(objectType))
            {
                CollectPrimitive(objectType, expected, result, parent, path);
            }
            else
            {
                if (!Begin(expected, result))
                {
                    return;
                }

                var difference = new ObjectDifference(parent, objectType, expected, result, path);
                if (parent == null)
                {
                    _rootDiff.Add(difference);
                }

                if (expected is IList expectedList && result is IList resultList)
                {
                    CollectList(expectedList, resultList, difference);
                }
Exemplo n.º 3
0
 public PrimitiveDifference(ObjectDifference parent, Type type, object expected, object result, string path) : base(parent, type, expected, result, path)
 {
 }