PeanutButter
Loading...
Searching...
No Matches
PeanutButter.TestUtils.Generic.SubstituteExtensions Class Reference

Provides extensions for substitutes to facilitate easier interrogation of the call history, eg when you want to pull an argument for an invocation to test against. More...

Classes

class  CallWrapper
 Wraps an NSubstitute ICall. More...

Static Public Member Functions

static CallWrapper[] ReceivedCalls (this object substitute, Func< CallWrapper, bool > filter)
 Retrieve all received calls for the provided substitute, filtered by the provided filter.
static CallWrapper[] ReceivedCalls (this object substitute, string methodName)
 Retrieve all recorded calls for the provided method on the provided substitute.
static bool DoesNotHaveUniqueMethodCalled (this object objOrType, string seek)
 Tests if a type or object only has one method with the provided name (ie no overloads, and a method with that name exists)

Detailed Description

Provides extensions for substitutes to facilitate easier interrogation of the call history, eg when you want to pull an argument for an invocation to test against.

Member Function Documentation

◆ DoesNotHaveUniqueMethodCalled()

bool PeanutButter.TestUtils.Generic.SubstituteExtensions.DoesNotHaveUniqueMethodCalled ( this object objOrType,
string seek )
static

Tests if a type or object only has one method with the provided name (ie no overloads, and a method with that name exists)

Parameters
objOrType
seek
Returns
Exceptions
ArgumentNullException

◆ ReceivedCalls() [1/2]

CallWrapper[] PeanutButter.TestUtils.Generic.SubstituteExtensions.ReceivedCalls ( this object substitute,
Func< CallWrapper, bool > filter )
static

Retrieve all received calls for the provided substitute, filtered by the provided filter.

Parameters
substitute
filter
Returns

◆ ReceivedCalls() [2/2]

CallWrapper[] PeanutButter.TestUtils.Generic.SubstituteExtensions.ReceivedCalls ( this object substitute,
string methodName )
static

Retrieve all recorded calls for the provided method on the provided substitute.

Parameters
substitute
methodName
Returns
Exceptions
ArgumentNullException
ArgumentException

The documentation for this class was generated from the following file:
  • source/TestUtils/PeanutButter.TestUtils.Generic/SubstituteExtensions.cs