C# Класс NUnit.Framework.Constraints.MsgUtils

Static methods used in creating messages
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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 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.

Описание методов

ClipExpectedAndActual() публичный статический Метод

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
Результат void

ClipString() публичный статический Метод

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
Результат string

EscapeControlChars() публичный статический Метод

Converts any control characters in a string to their escaped representation.
public static EscapeControlChars ( string s ) : string
s string The string to be converted
Результат string

FindMismatchPosition() статический публичный Метод

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
Результат int

GetArrayIndicesAsString() публичный статический Метод

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
Результат string

GetArrayIndicesFromCollectionIndex() публичный статический Метод

Get an array of indices representing the point in a 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
Результат int[]

GetTypeRepresentation() публичный статический Метод

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
Результат string