Edit

Share via


AssertionHelper.Expect Method

Definition

Overloads

Expect(Boolean)

Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean).

Expect(TestDelegate, IResolveConstraint)

Asserts that the code represented by a delegate throws an exception that satisfies the constraint provided.

Expect(Boolean, String)

Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean, String).

Expect(Boolean, String, Object[])

Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean, String, Object[]).

Expect<T>(ActualValueDelegate<T>, IResolveConstraint)
Expect<T>(T, IResolveConstraint)
Expect<T>(T, IResolveConstraint)
Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String)
Expect<T>(T, IResolveConstraint, String)
Expect<T>(T, IResolveConstraint, String)
Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String, Object[])
Expect<T>(T, IResolveConstraint, String, Object[])
Expect<T>(T, IResolveConstraint, String, Object[])

Expect(Boolean)

Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean).

public void Expect (bool condition);
member this.Expect : bool -> unit

Parameters

condition
Boolean

The evaluated condition

Applies to

Expect(TestDelegate, IResolveConstraint)

Asserts that the code represented by a delegate throws an exception that satisfies the constraint provided.

public void Expect (NUnit.Framework.TestDelegate code, NUnit.Framework.Constraints.IResolveConstraint constraint);
member this.Expect : NUnit.Framework.TestDelegate * NUnit.Framework.Constraints.IResolveConstraint -> unit

Parameters

code
TestDelegate

A TestDelegate to be executed

constraint
IResolveConstraint

A ThrowsConstraint used in the test

Applies to

Expect(Boolean, String)

Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean, String).

public void Expect (bool condition, string message);
member this.Expect : bool * string -> unit

Parameters

condition
Boolean

The evaluated condition

message
String

The message to display if the condition is false

Applies to

Expect(Boolean, String, Object[])

Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean, String, Object[]).

public void Expect (bool condition, string message, params object[] args);
member this.Expect : bool * string * obj[] -> unit

Parameters

condition
Boolean

The evaluated condition

message
String

The message to display if the condition is false

args
Object[]

Arguments to be used in formatting the message

Applies to

Expect<T>(ActualValueDelegate<T>, IResolveConstraint)

public void Expect<T> (NUnit.Framework.Constraints.ActualValueDelegate<T> del, NUnit.Framework.Constraints.IResolveConstraint expr);
member this.Expect : NUnit.Framework.Constraints.ActualValueDelegate<'T> * NUnit.Framework.Constraints.IResolveConstraint -> unit

Type Parameters

T

Parameters

Applies to

Expect<T>(T, IResolveConstraint)

public static void Expect<T> (T actual, NUnit.Framework.Constraints.IResolveConstraint expression);
static member Expect : 'T * NUnit.Framework.Constraints.IResolveConstraint -> unit

Type Parameters

T

Parameters

actual
T
expression
IResolveConstraint

Applies to

Expect<T>(T, IResolveConstraint)

public void Expect<T> (ref T actual, NUnit.Framework.Constraints.IResolveConstraint expression);
member this.Expect :  * NUnit.Framework.Constraints.IResolveConstraint -> unit

Type Parameters

T

Parameters

actual
T
expression
IResolveConstraint

Applies to

Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String)

public void Expect<T> (NUnit.Framework.Constraints.ActualValueDelegate<T> del, NUnit.Framework.Constraints.IResolveConstraint expr, string message);
member this.Expect : NUnit.Framework.Constraints.ActualValueDelegate<'T> * NUnit.Framework.Constraints.IResolveConstraint * string -> unit

Type Parameters

T

Parameters

message
String

Applies to

Expect<T>(T, IResolveConstraint, String)

public static void Expect<T> (T actual, NUnit.Framework.Constraints.IResolveConstraint expression, string message);
static member Expect : 'T * NUnit.Framework.Constraints.IResolveConstraint * string -> unit

Type Parameters

T

Parameters

actual
T
expression
IResolveConstraint
message
String

Applies to

Expect<T>(T, IResolveConstraint, String)

public void Expect<T> (ref T actual, NUnit.Framework.Constraints.IResolveConstraint expression, string message);
member this.Expect :  * NUnit.Framework.Constraints.IResolveConstraint * string -> unit

Type Parameters

T

Parameters

actual
T
expression
IResolveConstraint
message
String

Applies to

Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String, Object[])

public void Expect<T> (NUnit.Framework.Constraints.ActualValueDelegate<T> del, NUnit.Framework.Constraints.IResolveConstraint expr, string message, params object[] args);
member this.Expect : NUnit.Framework.Constraints.ActualValueDelegate<'T> * NUnit.Framework.Constraints.IResolveConstraint * string * obj[] -> unit

Type Parameters

T

Parameters

message
String
args
Object[]

Applies to

Expect<T>(T, IResolveConstraint, String, Object[])

public static void Expect<T> (T actual, NUnit.Framework.Constraints.IResolveConstraint expression, string message, params object[] args);
static member Expect : 'T * NUnit.Framework.Constraints.IResolveConstraint * string * obj[] -> unit

Type Parameters

T

Parameters

actual
T
expression
IResolveConstraint
message
String
args
Object[]

Applies to

Expect<T>(T, IResolveConstraint, String, Object[])

public void Expect<T> (ref T actual, NUnit.Framework.Constraints.IResolveConstraint expression, string message, params object[] args);
member this.Expect :  * NUnit.Framework.Constraints.IResolveConstraint * string * obj[] -> unit

Type Parameters

T

Parameters

actual
T
expression
IResolveConstraint
message
String
args
Object[]

Applies to