C# 클래스 NUnit.Framework.Constraints.MsgUtils

Static methods used in creating messages
파일 보기 프로젝트 열기: pjcollins/Andr.Unit 1 사용 예제들

공개 메소드들

메소드 설명
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