C# 클래스 NUnit.Framework.Assert

The Assert class contains a collection of static methods that implement the most common assertions used in NUnit.
파일 보기 프로젝트 열기: nunit/nunit 1 사용 예제들

공개 메소드들

메소드 설명
Contains ( object expected, ICollection actual ) : void

Asserts that an object is contained in a collection.

Contains ( object expected, ICollection actual, string message ) : void

Asserts that an object is contained in a collection.

Fail ( ) : void

Throws an AssertionException. This is used by the other Assert functions.

Fail ( string message ) : void

Throws an AssertionException with the message and arguments that are passed in. This is used by the other Assert functions.

Ignore ( ) : void

Throws an IgnoreException. This causes the test to be reported as ignored.

Ignore ( string message ) : void

Throws an IgnoreException with the message and arguments that are passed in. This causes the test to be reported as ignored.

Inconclusive ( ) : void

Throws an InconclusiveException. This causes the test to be reported as Inconclusive.

Inconclusive ( string message ) : void

Throws an InconclusiveException with the message and arguments that are passed in. This causes the test to be reported as inconclusive.

Multiple ( TestDelegate testDelegate ) : void

Wraps code containing a series of assertions, which should all be executed, even if they fail. Failed results are saved and reported at the end of the code block.

Pass ( ) : void

Throws a SuccessException with the message and arguments that are passed in. This allows a test to be cut short, with a result of success returned to NUnit.

Pass ( string message ) : void

Throws a SuccessException with the message and arguments that are passed in. This allows a test to be cut short, with a result of success returned to NUnit.

Warn ( string message ) : void

Issues a warning using the message and arguments provided.

보호된 메소드들

메소드 설명
Assert ( ) : System

We don't actually want any instances of this object, but some people like to inherit from it to add other static methods. Hence, the protected constructor disallows any instances of this object.

비공개 메소드들

메소드 설명
Equals ( object a, object b ) : bool
GetStackTrace ( ) : string
IncrementAssertCount ( ) : void
IssueWarning ( string message ) : void
ReferenceEquals ( object a, object b ) : void
ReportFailure ( ConstraintResult result, string message ) : void
ReportFailure ( string message ) : void

메소드 상세

Assert() 보호된 메소드

We don't actually want any instances of this object, but some people like to inherit from it to add other static methods. Hence, the protected constructor disallows any instances of this object.
protected Assert ( ) : System
리턴 System

Contains() 공개 정적인 메소드

Asserts that an object is contained in a collection.
public static Contains ( object expected, ICollection actual ) : void
expected object The expected object
actual ICollection The collection to be examined
리턴 void

Contains() 공개 정적인 메소드

Asserts that an object is contained in a collection.
public static Contains ( object expected, ICollection actual, string message ) : void
expected object The expected object
actual ICollection The collection to be examined
message string The message to display in case of failure
리턴 void

Fail() 정적인 공개 메소드

Throws an AssertionException. This is used by the other Assert functions.
static public Fail ( ) : void
리턴 void

Fail() 정적인 공개 메소드

Throws an AssertionException with the message and arguments that are passed in. This is used by the other Assert functions.
static public Fail ( string message ) : void
message string The message to initialize the with.
리턴 void

Ignore() 정적인 공개 메소드

Throws an IgnoreException. This causes the test to be reported as ignored.
static public Ignore ( ) : void
리턴 void

Ignore() 정적인 공개 메소드

Throws an IgnoreException with the message and arguments that are passed in. This causes the test to be reported as ignored.
static public Ignore ( string message ) : void
message string The message to initialize the with.
리턴 void

Inconclusive() 정적인 공개 메소드

Throws an InconclusiveException. This causes the test to be reported as Inconclusive.
static public Inconclusive ( ) : void
리턴 void

Inconclusive() 정적인 공개 메소드

Throws an InconclusiveException with the message and arguments that are passed in. This causes the test to be reported as inconclusive.
static public Inconclusive ( string message ) : void
message string The message to initialize the with.
리턴 void

Multiple() 공개 정적인 메소드

Wraps code containing a series of assertions, which should all be executed, even if they fail. Failed results are saved and reported at the end of the code block.
public static Multiple ( TestDelegate testDelegate ) : void
testDelegate TestDelegate A TestDelegate to be executed in Multiple Assertion mode.
리턴 void

Pass() 정적인 공개 메소드

Throws a SuccessException with the message and arguments that are passed in. This allows a test to be cut short, with a result of success returned to NUnit.
static public Pass ( ) : void
리턴 void

Pass() 정적인 공개 메소드

Throws a SuccessException with the message and arguments that are passed in. This allows a test to be cut short, with a result of success returned to NUnit.
static public Pass ( string message ) : void
message string The message to initialize the with.
리턴 void

Warn() 정적인 공개 메소드

Issues a warning using the message and arguments provided.
static public Warn ( string message ) : void
message string The message to display.
리턴 void