コード例 #1
0
        private EquivalencyValidationContext CreateNested(
            PropertyInfo subjectProperty, object subject, object expectation,
            string memberType, string memberDescription, string separator)
        {
            string propertyPath = IsRoot ? memberType : PropertyDescription + separator;

            return(new EquivalencyValidationContext
            {
                PropertyInfo = subjectProperty,
                Subject = subject,
                Expectation = expectation,
                PropertyPath = PropertyPath.Combine(memberDescription, separator),
                PropertyDescription = propertyPath + memberDescription,
                Reason = Reason,
                ReasonArgs = ReasonArgs,
                CompileTimeType = (subject != null) ? subject.GetType() : null,
            });
        }