NSubstitute
Argument matchers used for specifying calls to substitutes.
Match any argument value compatible with type .
Match argument that is equal to .
Match argument that satisfies .
If the throws an exception for an argument it will be treated as non-matching.
Invoke any argument as soon as a matching call is made to the substitute.
Invoke any argument with specified argument as soon as a matching call is made to the substitute.
Invoke any argument with specified arguments as soon as a matching call is made to the substitute.
Invoke any argument with specified arguments as soon as a matching call is made to the substitute.
Invoke any argument with specified arguments as soon as a matching call is made to the substitute.
Invoke any argument with specified arguments as soon as a matching call is made to the substitute.
Arguments to pass to delegate.
Capture any argument compatible with type and use it to call the function
as soon as a matching call is made to the substitute.
Provides a specification for arguments for use with .
Can additionally implement to give descriptions when arguments do not match.
Checks whether the satisfies the condition of the matcher.
If this throws an exception the argument will be treated as non-matching.
Describes how the does not match the condition specified by this class, or
if a detailed description can not be provided for the argument.
Description of the non-match, or if no description can be provided.
Combines two enumerables into a new enumerable using the given selector.
This implementation was sanity-checked against the
Edulinq implementation and
Eric Lippert's implementation.
Checks if the instance can be used when a is expected.
Join the using .
Delegates to ThreadLocal<T>, but wraps Value property access in try/catch to swallow ObjectDisposedExceptions.
These can occur if the Value property is accessed from the finalizer thread. Because we can't detect this, we'll
just swallow the exception (the finalizer thread won't be using any of the values from thread local storage anyway).
Provides a specification for arguments for use with .
Can additionally implement to give descriptions when arguments do not match.
Matches arguments of type or compatible type.
Checks whether the satisfies the condition of the matcher.
If this throws an exception the argument will be treated as non-matching.
Raise an event for an EventHandler<TEventArgs> event with the provided and .
Raise an event for an EventHandler<TEventArgs> event with the substitute as the sender and the provided .
Raise an event for an EventHandler<EventArgsT> event with the substitute as the sender
and with a default instance of .
Raise an event for an EventHandler or EventHandler<EventArgs> event with the substitute
as the sender and with empty EventArgs.
Raise an event of type with the provided arguments. If no arguments are provided
NSubstitute will try and provide reasonble defaults.
Create a substitute for one or more types. For example: Substitute.For<ISomeType>()
Substitute for an interface or class.
Be careful when specifying a class, as all non-virtual members will actually be executed. Only virtual members
can be recorded or have return values specified.
The type of interface or class to substitute.
Arguments required to construct a class being substituted. Not required for interfaces or classes with default constructors.
A substitute for the interface or class.
Substitute for multiple interfaces or a class that implements an interface. At most one class can be specified.
Be careful when specifying a class, as all non-virtual members will actually be executed. Only virtual members
can be recorded or have return values specified.
The type of interface or class to substitute.
An additional interface or class (maximum of one class) the substitute should implement.
Arguments required to construct a class being substituted. Not required for interfaces or classes with default constructors.
A substitute of type T1, that also implements T2.
Substitute for multiple interfaces or a class that implements multiple interfaces. At most one class can be specified.
If additional interfaces are required use the overload.
Be careful when specifying a class, as all non-virtual members will actually be executed. Only virtual members
can be recorded or have return values specified.
The type of interface or class to substitute.
An additional interface or class (maximum of one class) the substitute should implement.
An additional interface or class (maximum of one class) the substitute should implement.
Arguments required to construct a class being substituted. Not required for interfaces or classes with default constructors.
A substitute of type T1, that also implements T2 and T3.
Substitute for multiple interfaces or a class that implements multiple interfaces. At most one class can be specified.
Be careful when specifying a class, as all non-virtual members will actually be executed. Only virtual members
can be recorded or have return values specified.
The types of interfaces or a type of class and multiple interfaces the substitute should implement.
Arguments required to construct a class being substituted. Not required for interfaces or classes with default constructors.
A substitute implementing the specified types.