C# Class UnityEngine.NUnit.Framework.Constraints.MsgUtils

Static methods used in creating messages
Mostra file Open project: Unity-Technologies/nunitv2

Public Methods

Method Description
ClipExpectedAndActual ( string &expected, string &actual, int maxDisplayLength, int mismatch ) : void

Clip the expected and actual strings in a coordinated fashion, so that they may be displayed together.

ClipString ( string s, int maxStringLength, int clipStart ) : string

Clip a string to a given length, starting at a particular offset, returning the clipped string with ellipses representing the removed parts

EscapeControlChars ( string s ) : string

Converts any control characters in a string to their escaped representation.

FindMismatchPosition ( string expected, string actual, int istart, bool ignoreCase ) : int

Shows the position two strings start to differ. Comparison starts at the start index.

GetArrayIndicesAsString ( int indices ) : string

Return the a string representation for a set of indices into an array

GetArrayIndicesFromCollectionIndex ( IEnumerable collection, int index ) : int[]

Get an array of indices representing the point in a enumerable, collection or array corresponding to a single int index into the collection.

GetTypeRepresentation ( object obj ) : string

Returns the representation of a type as used in NUnitLite. This is the same as Type.ToString() except for arrays, which are displayed with their declared sizes.

Method Details

ClipExpectedAndActual() public static method

Clip the expected and actual strings in a coordinated fashion, so that they may be displayed together.
public static ClipExpectedAndActual ( string &expected, string &actual, int maxDisplayLength, int mismatch ) : void
expected string
actual string
maxDisplayLength int
mismatch int
return void

ClipString() public static method

Clip a string to a given length, starting at a particular offset, returning the clipped string with ellipses representing the removed parts
public static ClipString ( string s, int maxStringLength, int clipStart ) : string
s string The string to be clipped
maxStringLength int The maximum permitted length of the result string
clipStart int The point at which to start clipping
return string

EscapeControlChars() public static method

Converts any control characters in a string to their escaped representation.
public static EscapeControlChars ( string s ) : string
s string The string to be converted
return string

FindMismatchPosition() static public method

Shows the position two strings start to differ. Comparison starts at the start index.
static public FindMismatchPosition ( string expected, string actual, int istart, bool ignoreCase ) : int
expected string The expected string
actual string The actual string
istart int The index in the strings at which comparison should start
ignoreCase bool Boolean indicating whether case should be ignored
return int

GetArrayIndicesAsString() public static method

Return the a string representation for a set of indices into an array
public static GetArrayIndicesAsString ( int indices ) : string
indices int Array of indices for which a string is needed
return string

GetArrayIndicesFromCollectionIndex() public static method

Get an array of indices representing the point in a enumerable, collection or array corresponding to a single int index into the collection.
public static GetArrayIndicesFromCollectionIndex ( IEnumerable collection, int index ) : int[]
collection IEnumerable The collection to which the indices apply
index int Index in the collection
return int[]

GetTypeRepresentation() public static method

Returns the representation of a type as used in NUnitLite. This is the same as Type.ToString() except for arrays, which are displayed with their declared sizes.
public static GetTypeRepresentation ( object obj ) : string
obj object
return string