MessageWriter Class

Definition

MessageWriter is the abstract base for classes that write constraint descriptions and messages in some form. The class has separate methods for writing various components of a message, allowing implementations to tailor the presentation as needed.

public abstract class MessageWriter : System.IO.StringWriter
type MessageWriter = class
    inherit StringWriter
Inheritance
MessageWriter
Derived

Constructors

MessageWriter()

Construct a MessageWriter given a culture

Properties

MaxLineLength

Abstract method to get the max line length

Methods

DisplayDifferences(Constraint)

Display Expected and Actual lines for a constraint. This is called by MessageWriter's default implementation of WriteMessageTo and provides the generic two-line display.

DisplayDifferences(Object, Object)

Display Expected and Actual lines for given values. This method may be called by constraints that need more control over the display of actual and expected values than is provided by the default implementation.

DisplayDifferences(Object, Object, Tolerance)

Display Expected and Actual lines for given values, including a tolerance value on the Expected line.

DisplayStringDifferences(String, String, Int32, Boolean, Boolean)

Display the expected and actual string values on separate lines. If the mismatch parameter is >=0, an additional line is displayed line containing a caret that points to the mismatch point.

WriteActualValue(Object)

Writes the text for an actual value.

WriteCollectionElements(IEnumerable, Int32, Int32)
WriteConnector(String)

Writes the text for a connector.

WriteExpectedValue(Object)

Writes the text for an expected value.

WriteMessageLine(Int32, String, Object[])

Method to write single line message with optional args, usually written to precede the general failure message, at a givel indentation level.

WriteMessageLine(String, Object[])

Method to write single line message with optional args, usually written to precede the general failure message.

WriteModifier(String)

Writes the text for a modifier

WritePredicate(String)

Writes the text for a predicate.

WriteValue(Object)

Writes the text for a generalized value.

Applies to