Beispiel #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);
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #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"));
 }
Beispiel #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);
 }
Beispiel #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);
 }