Table of Contents

Class NSubstituteMockCollectionExtensions

Namespace
Mokkit.Containers.NSubstitute
Assembly
Mokkit.Containers.NSubstitute.dll

Convenience registration methods that create NSubstitute substitutes for the mock collection.

public static class NSubstituteMockCollectionExtensions

Inheritance

Inherited Members

Methods

AddSubstitute<T>(IMockCollection<object>)

Registers a substitute for T, throwing if one is already registered.

public static IMockCollection<object> AddSubstitute<T>(this IMockCollection<object> mocks) where T : class

Parameters

mocks IMockCollection<object>

The mock collection.

Returns

IMockCollection<object>

The collection for fluent chaining.

Type Parameters

T

The type to substitute.

TryAddSubstitute<T>(IMockCollection<object>)

Registers a substitute for T only if one is not already registered.

public static IMockCollection<object> TryAddSubstitute<T>(this IMockCollection<object> mocks) where T : class

Parameters

mocks IMockCollection<object>

The mock collection.

Returns

IMockCollection<object>

The collection for fluent chaining.

Type Parameters

T

The type to substitute.