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

Static methods used in creating messages
Afficher le fichier Open project: Unity-Technologies/nunitv2

Méthodes publiques

Méthode 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 méthode

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
Résultat void

ClipString() public static méthode

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
Résultat string

EscapeControlChars() public static méthode

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

FindMismatchPosition() static public méthode

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
Résultat int

GetArrayIndicesAsString() public static méthode

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
Résultat string

GetArrayIndicesFromCollectionIndex() public static méthode

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
Résultat int[]

GetTypeRepresentation() public static méthode

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
Résultat string