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