C# Class XunitShould.Should

显示文件 Open project: EddieGarmon/XunitShould

Public Methods

Method Description
ShouldBeFalse ( this condition ) : void

Verifies that the condition is false.

ShouldBeFalse ( this condition, Func messageGenerator ) : void

Verifies that the condition is false.

ShouldBeFalse ( this condition, string userMessage ) : void

Verifies that the condition is false.

ShouldBeNull ( this @object ) : void

Verifies that an object reference is null.

ShouldBeSameAs ( this actual, object expected ) : void

Verifies that two objects are the same instance.

ShouldBeTrue ( this condition ) : void

Verifies that an expression is true.

ShouldBeTrue ( this condition, Func messageGenerator ) : void

Verifies that an expression is true.

ShouldBeTrue ( this condition, string userMessage ) : void

Verifies that an expression is true.

ShouldChangeProperty ( this @object, string propertyName, System.Action testCode ) : void

Verifies that the provided object raised INotifyPropertyChanged.PropertyChanged as a result of executing the given test code.

ShouldContain ( this actual, string fragment, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
ShouldEndWith ( this actual, string ending, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
ShouldEqual ( this actual, string expected ) : void
ShouldEqual ( this actual, string expected, System.StringComparison comparisonType ) : void
ShouldEqual ( this actual, string expected, bool ignoreCase, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false ) : void
ShouldEqual ( this actual, string expected ) : void
ShouldMatch ( this actual, Regex pattern ) : void
ShouldMatch ( this actual, string regexPattern ) : void
ShouldNotBeNull ( this @object ) : void

Verifies that an object reference is not null.

ShouldNotBeSameAs ( this actual, object expected ) : void

Verifies that two objects are not the same instance.

ShouldNotContain ( this actual, string fragment, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
ShouldNotEndWith ( this actual, string ending, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
ShouldNotMatch ( this actual, Regex pattern ) : void
ShouldNotMatch ( this actual, string regexPattern ) : void
ShouldNotStartWith ( this actual, string begining, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
ShouldStartWith ( this actual, string begining, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void

Private Methods

Method Description
IsLineEnding ( char c ) : bool
IsWhiteSpace ( char c ) : bool
SkipLineEnding ( string value, int index ) : int
SkipWhitespace ( string value, int index ) : int

Method Details

ShouldBeFalse() public static method

Verifies that the condition is false.
Thrown if the condition is not false
public static ShouldBeFalse ( this condition ) : void
condition this The condition to be tested
return void

ShouldBeFalse() public static method

Verifies that the condition is false.
Thrown if the condition is not false
public static ShouldBeFalse ( this condition, Func messageGenerator ) : void
condition this The condition to be tested
messageGenerator Func The message to show when the condition is not false
return void

ShouldBeFalse() public static method

Verifies that the condition is false.
Thrown if the condition is not false
public static ShouldBeFalse ( this condition, string userMessage ) : void
condition this The condition to be tested
userMessage string The message to show when the condition is not false
return void

ShouldBeNull() public static method

Verifies that an object reference is null.
Thrown when the object reference is not null
public static ShouldBeNull ( this @object ) : void
@object this
return void

ShouldBeSameAs() public static method

Verifies that two objects are the same instance.
Thrown when the objects are not the same instance
public static ShouldBeSameAs ( this actual, object expected ) : void
actual this The actual object instance
expected object The expected object instance
return void

ShouldBeTrue() public static method

Verifies that an expression is true.
Thrown when the condition is false
public static ShouldBeTrue ( this condition ) : void
condition this The condition to be inspected
return void

ShouldBeTrue() public static method

Verifies that an expression is true.
Thrown when the condition is false
public static ShouldBeTrue ( this condition, Func messageGenerator ) : void
condition this The condition to be inspected
messageGenerator Func The message to be shown when the condition is false
return void

ShouldBeTrue() public static method

Verifies that an expression is true.
Thrown when the condition is false
public static ShouldBeTrue ( this condition, string userMessage ) : void
condition this The condition to be inspected
userMessage string The message to be shown when the condition is false
return void

ShouldChangeProperty() public static method

Verifies that the provided object raised INotifyPropertyChanged.PropertyChanged as a result of executing the given test code.
Thrown when the notification is not raised
public static ShouldChangeProperty ( this @object, string propertyName, System.Action testCode ) : void
@object this
propertyName string The property name for which the notification should be raised
testCode System.Action The test code which should cause the notification to be raised
return void

ShouldContain() public static method

public static ShouldContain ( this actual, string fragment, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
actual this
fragment string
comparisonType System.StringComparison
return void

ShouldEndWith() public static method

public static ShouldEndWith ( this actual, string ending, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
actual this
ending string
comparisonType System.StringComparison
return void

ShouldEqual() public static method

public static ShouldEqual ( this actual, string expected ) : void
actual this
expected string
return void

ShouldEqual() public static method

public static ShouldEqual ( this actual, string expected, System.StringComparison comparisonType ) : void
actual this
expected string
comparisonType System.StringComparison
return void

ShouldEqual() public static method

public static ShouldEqual ( this actual, string expected, bool ignoreCase, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false ) : void
actual this
expected string
ignoreCase bool
ignoreLineEndingDifferences bool
ignoreWhiteSpaceDifferences bool
return void

ShouldEqual() public static method

public static ShouldEqual ( this actual, string expected ) : void
actual this
expected string
return void

ShouldMatch() public static method

public static ShouldMatch ( this actual, Regex pattern ) : void
actual this
pattern Regex
return void

ShouldMatch() public static method

public static ShouldMatch ( this actual, string regexPattern ) : void
actual this
regexPattern string
return void

ShouldNotBeNull() public static method

Verifies that an object reference is not null.
Thrown when the object is not null
public static ShouldNotBeNull ( this @object ) : void
@object this
return void

ShouldNotBeSameAs() public static method

Verifies that two objects are not the same instance.
Thrown when the objects are the same instance
public static ShouldNotBeSameAs ( this actual, object expected ) : void
actual this The actual object instance
expected object The expected object instance
return void

ShouldNotContain() public static method

public static ShouldNotContain ( this actual, string fragment, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
actual this
fragment string
comparisonType System.StringComparison
return void

ShouldNotEndWith() public static method

public static ShouldNotEndWith ( this actual, string ending, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
actual this
ending string
comparisonType System.StringComparison
return void

ShouldNotMatch() public static method

public static ShouldNotMatch ( this actual, Regex pattern ) : void
actual this
pattern Regex
return void

ShouldNotMatch() public static method

public static ShouldNotMatch ( this actual, string regexPattern ) : void
actual this
regexPattern string
return void

ShouldNotStartWith() public static method

public static ShouldNotStartWith ( this actual, string begining, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
actual this
begining string
comparisonType System.StringComparison
return void

ShouldStartWith() public static method

public static ShouldStartWith ( this actual, string begining, System.StringComparison comparisonType = StringComparison.CurrentCulture ) : void
actual this
begining string
comparisonType System.StringComparison
return void