/// <summary>
        /// Gets a value indicating whether this step can handle the current subject and/or expectation.
        /// </summary>
        public bool CanHandle(IEquivalencyValidationContext context, IEquivalencyAssertionOptions config)
        {
            Type type = config.GetSubjectType(context);

            return 
                (type != null) && 
                (type != typeof (object)) && 
                config.IsValueType(type) && 
                !type.IsArray;
        }
예제 #2
0
        /// <summary>
        /// Gets a value indicating whether this step can handle the current subject and/or expectation.
        /// </summary>
        public bool CanHandle(IEquivalencyValidationContext context, IEquivalencyAssertionOptions config)
        {
            Type type = config.GetSubjectType(context);

            return
                ((type != null) &&
                 (type != typeof(object)) &&
                 config.IsValueType(type) &&
                 !type.IsArray);
        }
예제 #3
0
        /// <summary>
        /// Gets a value indicating whether this step can handle the current subject and/or expectation.
        /// </summary>
        public bool CanHandle(IEquivalencyValidationContext context, IEquivalencyAssertionOptions config)
        {
            Type type = config.GetSubjectType(context);

            bool canHandle =
                (type != null) &&
                (type != typeof(object)) &&
                config.IsValueType(type) &&
                !type.IsArray;

            if (canHandle)
            {
                context.TraceSingle(path => $"Treating {path} as a value type");
            }

            return(canHandle);
        }
예제 #4
0
 public bool IsValueType(Type type)
 {
     return(inner.IsValueType(type));
 }