The Mock type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | Mock |
Constructer, keep internal
|
Methods
Name | Description | |
---|---|---|
![]() | AlwaysCallOriginal |
Sets the expectaion of this method to always call the original method.
|
![]() | AlwaysReturn | Overloaded. |
![]() | AlwaysThrow | Overloaded. |
![]() | AnonymousMethodOf |
Use to mock all anonymous methods that are called from within a method
|
![]() | AssignField |
Assign a new value to the given field.
|
![]() | ChangeConstructor |
Constructer swaping with the mocked one, keep internal
|
![]() | Clear | Overloaded. |
![]() | EndBlock |
End an expectation block
|
![]() | ExpectAddEvent | Overloaded. |
![]() | ExpectAddEventAlways |
Expect unlimited number of event listeners to be added (event += new EventHandler())
|
![]() | ExpectAlways |
Expect unlimited calls from method
|
![]() | ExpectAndReturn | Overloaded. |
![]() | ExpectAndThrow | Overloaded. |
![]() | ExpectCall | Overloaded. |
![]() | ExpectCallAndVerify | Obsolete.
Verify 1 call from method , continue with method as normal
|
![]() | ExpectConstructor | Overloaded. |
![]() | ExpectConstructorAlways |
Mock unlimited calls from Constructor
|
![]() | ExpectConstructorAndThrow |
Mock Constructor and throw exception when constructor is called
|
![]() | ExpectGet | Overloaded. |
![]() | ExpectGetAlways |
Expect unlimited get of a Property and always mock the Property's value
|
![]() | ExpectGetAndAlwaysThrow |
Expect unlimited get of a Property and always mock throwing an exception
|
![]() | ExpectGetAndThrow | Overloaded. |
![]() | ExpectGetIndex | Overloaded. |
![]() | ExpectGetIndexAlways |
Expect unlimited set of an Index and mock throwing an exception
|
![]() | ExpectGetIndexAndAlwaysThrow |
Expect unlimited set of an Index and mock throwing an exception
|
![]() | ExpectGetIndexAndThrow | Overloaded. |
![]() | ExpectRemoveEvent | Overloaded. |
![]() | ExpectSet | Overloaded. |
![]() | ExpectSetAlways |
Expect unlimited set of a Property
|
![]() | ExpectSetAndAlwaysThrow |
Expect unlimited set of a Property and always mock throwing an exception
|
![]() | ExpectSetAndThrow | Overloaded. |
![]() | ExpectSetIndex | Overloaded. |
![]() | ExpectSetIndexAlways |
Expect unlimited set of an Index
|
![]() | ExpectSetIndexAndAlwaysThrow |
Expect unlimited set of an Index and mock throwing an exception
|
![]() | ExpectSetIndexAndThrow | Overloaded. |
![]() | ExpectUnmockedCall | Overloaded. |
![]() | ExpectUnmockedConstructor | Overloaded. |
![]() | ExpectUnmockedGet | Overloaded. |
![]() | ExpectUnmockedSet | Overloaded. |
![]() | GetBlock |
Retrieve Expectation Block, by its label name
|
![]() | GetCallCount | Overloaded. |
![]() | GetCallIndexerCounter |
Return the amount of times an indexer has been called
|
![]() | GetCallPropertyGetCounter |
Return the amount of times a property has been called
|
![]() | GetCallPropertySetCounter |
Return the amount of times a property has been set
|
![]() | MethodSettings |
Perform Behavior tweaking on methods rather then the whole mocked type
|
![]() | MethodSettingsGetIndex |
Perform Behavior tweaking on methods rather then the whole mocked type
|
![]() | MethodSettingsGetProperty |
Perform Behavior tweaking on methods rather then the whole mocked type
|
![]() | MethodSettingsSetIndex |
Perform Behavior tweaking on methods rather then the whole mocked type
|
![]() | MethodSettingsSetProperty |
Perform Behavior tweaking on methods rather then the whole mocked type
|
![]() | MockConstructor | Obsolete.
Mock Constructor
|
![]() | MockField | Create a Mock object and assign it to a given field. |
![]() | RemoveStaticCtor |
Remobing static constructer, keep internal
|
![]() | StartBlock | Overloaded. |
![]() | StartBlockBefore | Overloaded. |
![]() | Verify |
Verify mocked type
|
![]() | VerifyWithTimeout | Overloaded. |
Properties
Name | Description | |
---|---|---|
![]() | CallBase |
Allow mocking a method in a base class that is hidden by the mocked class
|
![]() | CallStatic |
Allow mocking a static method when that method is overloaded with an instance method
|
![]() | MockedInstance |
Get the actual instance that is being mocked and controlled. This
enables tracking instance mocks to the actual instance
|
![]() | MockedType |
Get the type that is mocked and controlled.
|
![]() | Strict |
Can set the mock to be Strict
The default is the Methods of Abstract and Interfaces are Strict and Arbitrary calls fail
while Arbitrary Methods of concrete classes are allowed.
|
![]() | StrictStatic |
Can set the static methods of a mocked type to be Strict
|
![]() | ValidateArgsOnVerify | Obsolete.
Obslolete. Argument validation is done both on calling the method and during Verify.
|
Events
Name | Description | |
---|---|---|
![]() | MockMethodCalled |
Event that is fired after a mocked method is called and after argument validation is performed
MockMethodCalledEventHandler
|