NUnit.Framework
Namespace with 77 public types
Classes
Assert
The Assert class contains a collection of static methods that
implement the most common assertions used in NUnit.
AssertionException
Thrown when an assertion failed.
AssertionHelper
AssertionHelper is an optional base class for user tests,
allowing the use of shorter names for constraints and
asserts and avoiding conflict with the definition of
, from which it inherits much of its
behavior, in certain mock object frameworks.
Assume
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.
CategoryAttribute
Attribute used to apply a category to a test
CollectionAssert
A set of Assert methods operationg on one or more collections
CombinatorialAttribute
Marks a test to use a combinatorial join of any argument data
provided. NUnit will create a test case for every combination of
the arguments provided. This can result in a large number of test
cases and so should be used judiciously. This is the default join
type, so the attribute need not be used except as documentation.
Contains
Helper class with properties and methods that supply
a number of constraints used in Asserts.
CultureAttribute
CultureAttribute is used to mark a test fixture or an
individual method as applying to a particular Culture only.
DatapointAttribute
Used to mark a field for use as a datapoint when executing a theory
within the same fixture that requires an argument of the field's Type.
DatapointsAttribute
Used to mark an array as containing a set of datapoints to be used
executing a theory within the same fixture that requires an argument
of the Type of the array elements.
DescriptionAttribute
Attribute used to provide descriptive text about a
test case or fixture.
DirectoryAssert
Summary description for DirectoryAssert
ExpectedExceptionAttribute
ExpectedExceptionAttribute
ExplicitAttribute
ExplicitAttribute marks a test or test fixture so that it will
only be run if explicitly executed from the gui or command line
or if it is included by use of a filter. The test will not be
run simply because an enclosing suite is run.
FileAssert
Summary description for FileAssert.
GlobalSettings
GlobalSettings is a place for setting default values used
by the framework in performing asserts.
Guard
Class used to guard against unexpected argument values
by throwing an appropriate exception.
Has
Helper class with properties and methods that supply
a number of constraints used in Asserts.
IgnoreAttribute
Attribute used to mark a test that is to be ignored.
Ignored tests result in a warning message when the
tests are run.
IgnoreException
Thrown when an assertion failed.
InconclusiveException
Thrown when a test executes inconclusively.
Is
Helper class with properties and methods that supply
a number of constraints used in Asserts.
Iz
The Iz class is a synonym for Is intended for use in VB,
which regards Is as a keyword.
List
The List class is a helper class with properties and methods
that supply a number of constraints used with lists and collections.
ListMapper
ListMapper is used to transform a collection used as an actual argument
producing another collection to be used in the assertion.
MaxTimeAttribute
Summary description for MaxTimeAttribute.
PairwiseAttribute
Marks a test to use pairwise join of any argument data provided.
NUnit will attempt too excercise every pair of argument values at
least once, using as small a number of test cases as it can. With
only two arguments, this is the same as a combinatorial join.
PlatformAttribute
PlatformAttribute is used to mark a test fixture or an
individual method as applying to a particular platform only.
PropertyAttribute
PropertyAttribute is used to attach information to a test as a name/value pair..
RandomAttribute
RandomAttribute is used to supply a set of random values
to a single parameter of a parameterized test.
Randomizer
Randomizer returns a set of random values in a repeatable
way, to allow re-running of tests if necessary.
RangeAttribute
RangeAttribute is used to supply a range of values to an
individual parameter of a parameterized test.
RepeatAttribute
RepeatAttribute may be applied to test case in order
to run it multiple times.
RequiredAddinAttribute
RequiredAddinAttribute may be used to indicate the names of any addins
that must be present in order to run some or all of the tests in an
assembly. If the addin is not loaded, the entire assembly is marked
as NotRunnable.
RequiresMTAAttribute
Marks a test that must run in the MTA, causing it
to run in a separate thread if necessary.
On methods, you may also use MTAThreadAttribute
to serve the same purpose.
RequiresSTAAttribute
Marks a test that must run in the STA, causing it
to run in a separate thread if necessary.
On methods, you may also use STAThreadAttribute
to serve the same purpose.
RequiresThreadAttribute
Marks a test that must run on a separate thread.
SequentialAttribute
Marks a test to use a sequential join of any argument data
provided. NUnit will use arguements for each parameter in
sequence, generating test cases up to the largest number
of argument values provided and using null for any arguments
for which it runs out of values. Normally, this should be
used with the same number of arguments for each parameter.
SetCultureAttribute
Summary description for SetCultureAttribute.
SetUICultureAttribute
Summary description for SetUICultureAttribute.
SetUpAttribute
SetUpAttribute is used in a TestFixture to identify a method
that is called immediately before each test is run. It is
also used in a SetUpFixture to identify the method that is
called once, before any of the subordinate tests are run.
SetUpFixtureAttribute
Attribute used to mark a class that contains one-time SetUp
and/or TearDown methods that apply to all the tests in a
namespace or an assembly.
StringAssert
Basic Asserts on strings.
SuccessException
Thrown when an assertion failed.
SuiteAttribute
Attribute used to mark a static (shared in VB) property
that returns a list of tests.
TearDownAttribute
Attribute used in a TestFixture to identify a method that is
called immediately after each test is run. It is also used
in a SetUpFixture to identify the method that is called once,
after all subordinate tests have run. In either case, the method
is guaranteed to be called, even if an exception is thrown.
TestAttribute
Adding this attribute to a method within a
class makes the method callable from the NUnit test runner. There is a property
called Description which is optional which you can provide a more detailed test
description. This class cannot be inherited.
TestCaseAttribute
TestCaseAttribute is used to mark parameterized test cases
and provide them with their arguments.
TestCaseData
The TestCaseData class represents a set of arguments
and other parameter info to be used for a parameterized
test case. It provides a number of instance modifiers
for use in initializing the test case.
Note: Instance modifiers are getters that return
the same instance after modifying it's state.
TestCaseSourceAttribute
FactoryAttribute indicates the source to be used to
provide test cases for a test method.
TestContext
Provide the context information of the current test
TestDetails
Provides details about a test
TestFixtureAttribute
TestFixtureSetUpAttribute
Attribute used to identify a method that is
called before any tests in a fixture are run.
TestFixtureTearDownAttribute
Attribute used to identify a method that is called after
all the tests in a fixture have run. The method is
guaranteed to be called, even if an exception is thrown.
Text
Helper class with static methods used to supply constraints
that operate on strings.
TextMessageWriter
TextMessageWriter writes constraint descriptions and messages
in displayable form as a text stream. It tailors the display
of individual message components to form the standard message
format of NUnit assertion failure messages.
TheoryAttribute
Adding this attribute to a method within a
class makes the method callable from the NUnit test runner. There is a property
called Description which is optional which you can provide a more detailed test
description. This class cannot be inherited.
Throws
Helper class with properties and methods that supply
constraints that operate on exceptions.
TimeoutAttribute
Used on a method, marks the test with a timeout value in milliseconds.
The test will be run in a separate thread and is cancelled if the timeout
is exceeded. Used on a method or assembly, sets the default timeout
for all contained test methods.
ValuesAttribute
ValuesAttribute is used to provide literal arguments for
an individual parameter of a test.
ValueSourceAttribute
ValueSourceAttribute indicates the source to be used to
provide data for one parameter of a test method.
Enumerations
ActionTargets
The different targets a test action attribute can be applied to
MessageMatch
Enumeration indicating how the expected message parameter is to be used
SpecialValue
The SpecialValue enum is used to represent TestCase arguments
that cannot be used as arguments to an Attribute.
TestState
The ResultState enum indicates the result of running a test
TestStatus
The TestStatus enum indicates the result of running a test
Abstract Classes
IncludeExcludeAttribute
Abstract base for Attributes that are used to include tests
in the test run based on environmental settings.
ParameterDataAttribute
Abstract base class for attributes that apply to parameters
and supply data for the parameter.
TestActionAttribute
Provide actions to execute before and after tests.
Interfaces
IExpectException
Interface implemented by a user fixture in order to
validate any expected exceptions. It is only called
for test methods marked with the ExpectedException
attribute.
INUnitEqualityComparer
INUnitEqualityComparer`1
ITestAction
When implemented by an attribute, this interface implemented to provide actions to execute before and after tests.
ITestCaseData
The ITestCaseData interface is implemented by a class
that is able to return complete testcases for use by
a parameterized test method.
NOTE: This interface is used in both the framework
and the core, even though that results in two different
types. However, sharing the source code guarantees that
the various implementations will be compatible and that
the core is able to reflect successfully over the
framework implementations of ITestCaseData.