Table of Contents

Class Assume

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

Provides static methods to express the assumptions that must be met for a test to give a meaningful result. If an assumption is not met, the test should produce an inconclusive result.

public class Assume
Inheritance
Assume
Inherited Members

Constructors

Assume()

public Assume()

Methods

ReferenceEquals(object, object)

override the default ReferenceEquals to throw an AssertionException. This implementation makes sure there is no mistake in calling this function as part of Assert.

public static void ReferenceEquals(object a, object b)

Parameters

a object
b object

That(TestDelegate, IResolveConstraint)

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

public static void That(TestDelegate code, IResolveConstraint constraint)

Parameters

code TestDelegate

A TestDelegate to be executed

constraint IResolveConstraint

A ThrowsConstraint used in the test

That(bool)

Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.

public static void That(bool condition)

Parameters

condition bool

The evaluated condition

That(bool, string)

Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.

public static void That(bool condition, string message)

Parameters

condition bool

The evaluated condition

message string

The message to display if the condition is false

That(bool, string, params object[])

Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.

public static void That(bool condition, string message, params object[] args)

Parameters

condition bool

The evaluated condition

message string

The message to display if the condition is false

args object[]

Arguments to be used in formatting the message

That(Func<bool>)

Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.

public static void That(Func<bool> condition)

Parameters

condition Func<bool>

A lambda that returns a Boolean

That(Func<bool>, string)

Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.

public static void That(Func<bool> condition, string message)

Parameters

condition Func<bool>

A lambda that returns a Boolean

message string

The message to display if the condition is false

That(Func<bool>, string, params object[])

Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.

public static void That(Func<bool> condition, string message, params object[] args)

Parameters

condition Func<bool>

A lambda that returns a Boolean

message string

The message to display if the condition is false

args object[]

Arguments to be used in formatting the message

That<TActual>(ActualValueDelegate<TActual>, IResolveConstraint)

Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.

public static void That<TActual>(ActualValueDelegate<TActual> del, IResolveConstraint expr)

Parameters

del ActualValueDelegate<TActual>

An ActualValueDelegate returning the value to be tested

expr IResolveConstraint

A Constraint expression to be applied

Type Parameters

TActual

That<TActual>(ActualValueDelegate<TActual>, IResolveConstraint, string)

Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.

public static void That<TActual>(ActualValueDelegate<TActual> del, IResolveConstraint expr, string message)

Parameters

del ActualValueDelegate<TActual>

An ActualValueDelegate returning the value to be tested

expr IResolveConstraint

A Constraint expression to be applied

message string

The message that will be displayed on failure

Type Parameters

TActual

That<TActual>(ActualValueDelegate<TActual>, IResolveConstraint, string, params object[])

Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.

public static void That<TActual>(ActualValueDelegate<TActual> del, IResolveConstraint expr, string message, params object[] args)

Parameters

del ActualValueDelegate<TActual>

An ActualValueDelegate returning the value to be tested

expr IResolveConstraint

A Constraint expression to be applied

message string

The message that will be displayed on failure

args object[]

Arguments to be used in formatting the message

Type Parameters

TActual

That<TActual>(TActual, IResolveConstraint)

Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.

public static void That<TActual>(TActual actual, IResolveConstraint expression)

Parameters

actual TActual

The actual value to test

expression IResolveConstraint

A Constraint to be applied

Type Parameters

TActual

That<TActual>(TActual, IResolveConstraint, string)

Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.

public static void That<TActual>(TActual actual, IResolveConstraint expression, string message)

Parameters

actual TActual

The actual value to test

expression IResolveConstraint

A Constraint to be applied

message string

The message that will be displayed on failure

Type Parameters

TActual

That<TActual>(TActual, IResolveConstraint, string, params object[])

Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.

public static void That<TActual>(TActual actual, IResolveConstraint expression, string message, params object[] args)

Parameters

actual TActual

The actual value to test

expression IResolveConstraint

A Constraint expression to be applied

message string

The message that will be displayed on failure

args object[]

Arguments to be used in formatting the message

Type Parameters

TActual

That<TActual>(ref TActual, IResolveConstraint)

Apply a constraint to a referenced value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.

public static void That<TActual>(ref TActual actual, IResolveConstraint expression)

Parameters

actual TActual

The actual value to test

expression IResolveConstraint

A Constraint to be applied

Type Parameters

TActual

That<TActual>(ref TActual, IResolveConstraint, string)

Apply a constraint to a referenced value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.

public static void That<TActual>(ref TActual actual, IResolveConstraint expression, string message)

Parameters

actual TActual

The actual value to test

expression IResolveConstraint

A Constraint to be applied

message string

The message that will be displayed on failure

Type Parameters

TActual

That<TActual>(ref TActual, IResolveConstraint, string, params object[])

Apply a constraint to a referenced value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.

public static void That<TActual>(ref TActual actual, IResolveConstraint expression, string message, params object[] args)

Parameters

actual TActual

The actual value to test

expression IResolveConstraint

A Constraint to be applied

message string

The message that will be displayed on failure

args object[]

Arguments to be used in formatting the message

Type Parameters

TActual