示例#1
0
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public abstract void WriteDescriptionTo(MessageWriter writer);
示例#2
0
 /// <summary>
 ///     Write the internalActual value for a failing constraint test to a
 ///     MessageWriter. The default implementation simply writes
 ///     the raw value of internalActual, leaving it to the writer to
 ///     perform any formatting.
 /// </summary>
 /// <param name="writer">The writer on which the internalActual value is displayed</param>
 public virtual void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteActualValue(internalActual);
 }
示例#3
0
 /// <summary>
 ///     Write the internalActual value for a failing constraint test to a
 ///     MessageWriter.
 /// </summary>
 /// <param name="writer">The writer on which the internalActual value is displayed</param>
 public override void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteActualValue(actualType);
 }
示例#4
0
 /// <summary>
 ///     Write the failure message to the MessageWriter provided
 ///     as an argument. The default implementation simply passes
 ///     the constraint and the internalActual value to the writer, which
 ///     then displays the constraint description and the value.
 ///     Constraints that need to provide additional details,
 ///     such as where the error occured can override this.
 /// </summary>
 /// <param name="writer">The MessageWriter on which to display the message</param>
 public virtual void WriteMessageTo(MessageWriter writer)
 {
     writer.DisplayDifferences(this);
 }
示例#5
0
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write("property " + name);
 }
 /// <summary>
 ///     Write the internalActual value for a failing constraint test to a
 ///     MessageWriter. Overridden in ThrowsNothingConstraint to write
 ///     information about the exception that was actually caught.
 /// </summary>
 /// <param name="writer">The writer on which the internalActual value is displayed</param>
 public override void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteLine(" ({0})", caughtException.Message);
     writer.Write(caughtException.StackTrace);
 }
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write(string.Format("No Exception to be thrown"));
 }
示例#8
0
 /// <summary>
 ///     Write a description of this constraint to a MessageWriter
 /// </summary>
 /// <param name="writer">The MessageWriter to use</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.WritePredicate("assignable to");
     writer.WriteExpectedValue(expectedType);
 }
示例#9
0
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.WritePredicate("greater than");
     writer.WriteExpectedValue(expected);
 }