Example #1
0
        /// <summary>
        /// Write the actual value for a failing constraint test to a
        /// MessageWriter. TypeCOnstraints override this method to write the
        /// name of the type.
        /// </summary>
        /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
        /// <param name="writer">The writer on which the actual value is displayed</param>
        public override void WriteActualValueTo( MessageWriter writer )
        {
            if ( writer == null )
            {
                throw new ArgumentNullException( "writer" );
            }

            writer.WriteActualValue( Actual == null ? null : Actual.GetType() );
        }
Example #2
0
        /// <summary>
        /// Write the actual value for a failing constraint test to a
        /// MessageWriter. The default implementation simply writes the raw
        /// value of actual, leaving it to the writer to perform any formatting.
        /// </summary>
        /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
        /// <param name="writer">The writer on which the actual value is displayed</param>
        public override void WriteActualValueTo( MessageWriter writer )
        {
            if ( writer == null )
            {
                throw new ArgumentNullException( "writer" );
            }

            if ( _propertyExists )
            {
                writer.WriteActualValue( _propValue );
            }
            else
            {
                writer.WriteActualValue( Actual.GetType() );
            }
        }
Example #3
0
 /// <summary>
 /// Write the actual value for a failing constraint test to a
 /// MessageWriter. The default implementation simply writes the raw
 /// value of actual, leaving it to the writer to perform any formatting.
 /// </summary>
 /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
 /// <param name="writer">The writer on which the actual value is displayed</param>
 public virtual void WriteActualValueTo( MessageWriter writer )
 {
     if ( writer == null )
     {
         throw new ArgumentNullException( "writer" );
     }
     writer.WriteActualValue( _actual );
 }