C# Class UnityEngine.NUnit.Framework.TextMessageWriter

TextMessageWriter writes constraint descriptions and messages in displayable form as a text stream. It tailors the display of individual message components to form the standard message format of NUnit assertion failure messages.
Inheritance: UnityEngine.NUnit.Framework.Constraints.MessageWriter
Afficher le fichier Open project: Unity-Technologies/nunitv2

Méthodes publiques

Свойство Type Description
Pfx_Actual string
Pfx_Expected string
PrefixLength int

Méthodes publiques

Méthode Description
DisplayDifferences ( Constraint constraint ) : void

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 expected, object actual ) : void

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 expected, object actual, Tolerance tolerance ) : void

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

DisplayStringDifferences ( string expected, string actual, int mismatch, bool ignoreCase, bool clipping ) : void

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.

TextMessageWriter ( ) : System

Construct a TextMessageWriter

TextMessageWriter ( string userMessage ) : System

Construct a TextMessageWriter, specifying a user message and optional formatting arguments.

WriteActualValue ( object actual ) : void

Writes the text for an actual value.

WriteCollectionElements ( IEnumerable collection, int start, int max ) : void

Writes the text for a collection value, starting at a particular point, to a max length

WriteConnector ( string connector ) : void

Writes the text for a connector.

WriteExpectedValue ( object expected ) : void

Writes the text for an expected value.

WriteMessageLine ( int level, string message ) : void

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

WriteModifier ( string modifier ) : void

Write the text for a modifier.

WritePredicate ( string predicate ) : void

Writes the text for a predicate.

WriteValue ( object val ) : void

Writes the text for a generalized value.

Private Methods

Méthode Description
WriteActualLine ( Constraint constraint ) : void

Write the generic 'Actual' line for a constraint

WriteActualLine ( object actual ) : void

Write the generic 'Actual' line for a given value

WriteArray ( Array array ) : void
WriteCaretLine ( int mismatch ) : void
WriteChar ( char c ) : void
WriteDateTime ( System.DateTime dt ) : void
WriteDecimal ( Decimal d ) : void
WriteDouble ( double d ) : void
WriteExpectedLine ( Constraint constraint ) : void

Write the generic 'Expected' line for a constraint

WriteExpectedLine ( object expected ) : void

Write the generic 'Expected' line for a given value

WriteExpectedLine ( object expected, Tolerance tolerance ) : void

Write the generic 'Expected' line for a given value and tolerance.

WriteFloat ( float f ) : void
WriteString ( string s ) : void

Method Details

DisplayDifferences() public méthode

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.
public DisplayDifferences ( Constraint constraint ) : void
constraint Constraint The constraint that failed
Résultat void

DisplayDifferences() public méthode

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.
public DisplayDifferences ( object expected, object actual ) : void
expected object The expected value
actual object The actual value causing the failure
Résultat void

DisplayDifferences() public méthode

Display Expected and Actual lines for given values, including a tolerance value on the expected line.
public DisplayDifferences ( object expected, object actual, Tolerance tolerance ) : void
expected object The expected value
actual object The actual value causing the failure
tolerance UnityEngine.NUnit.Framework.Constraints.Tolerance The tolerance within which the test was made
Résultat void

DisplayStringDifferences() public méthode

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.
public DisplayStringDifferences ( string expected, string actual, int mismatch, bool ignoreCase, bool clipping ) : void
expected string The expected string value
actual string The actual string value
mismatch int The point at which the strings don't match or -1
ignoreCase bool If true, case is ignored in string comparisons
clipping bool If true, clip the strings to fit the max line length
Résultat void

TextMessageWriter() public méthode

Construct a TextMessageWriter
public TextMessageWriter ( ) : System
Résultat System

TextMessageWriter() public méthode

Construct a TextMessageWriter, specifying a user message and optional formatting arguments.
public TextMessageWriter ( string userMessage ) : System
userMessage string
Résultat System

WriteActualValue() public méthode

Writes the text for an actual value.
public WriteActualValue ( object actual ) : void
actual object The actual value.
Résultat void

WriteCollectionElements() public méthode

Writes the text for a collection value, starting at a particular point, to a max length
public WriteCollectionElements ( IEnumerable collection, int start, int max ) : void
collection IEnumerable The collection containing elements to write.
start int The starting point of the elements to write
max int The maximum number of elements to write
Résultat void

WriteConnector() public méthode

Writes the text for a connector.
public WriteConnector ( string connector ) : void
connector string The connector.
Résultat void

WriteExpectedValue() public méthode

Writes the text for an expected value.
public WriteExpectedValue ( object expected ) : void
expected object The expected value.
Résultat void

WriteMessageLine() public méthode

Method to write single line message with optional args, usually written to precede the general failure message, at a givel indentation level.
public WriteMessageLine ( int level, string message ) : void
level int The indentation level of the message
message string The message to be written
Résultat void

WriteModifier() public méthode

Write the text for a modifier.
public WriteModifier ( string modifier ) : void
modifier string The modifier.
Résultat void

WritePredicate() public méthode

Writes the text for a predicate.
public WritePredicate ( string predicate ) : void
predicate string The predicate.
Résultat void

WriteValue() public méthode

Writes the text for a generalized value.
public WriteValue ( object val ) : void
val object The value.
Résultat void

Property Details

Pfx_Actual public_oe static_oe property

Prefix used for the actual value line of a message
public static string Pfx_Actual
Résultat string

Pfx_Expected public_oe static_oe property

Prefix used for the expected value line of a message
public static string Pfx_Expected
Résultat string

PrefixLength public_oe static_oe property

Length of a message prefix
public static int PrefixLength
Résultat int