The MockObject type exposes the following members.

Methods

  NameDescription
AlwaysCallOriginal
Sets the expectaion of this method to always call the original method.
(Inherited from Mock.)
AlwaysReturnOverloaded.
AlwaysThrowOverloaded.
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.)
ClearOverloaded.
EndBlock
End an expectation block
(Inherited from Mock.)
ExpectAddEventOverloaded.
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.)
ExpectAndReturnOverloaded.
ExpectAndThrowOverloaded.
ExpectCallOverloaded.
ExpectCallAndVerify Obsolete.
Verify 1 call from method , continue with method as normal
(Inherited from Mock.)
ExpectConstructorOverloaded.
ExpectConstructorAlways
Mock unlimited calls from Constructor
(Inherited from Mock.)
ExpectConstructorAndThrow
Mock Constructor and throw exception when constructor is called
(Inherited from Mock.)
ExpectGetOverloaded.
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.)
ExpectGetAndThrowOverloaded.
ExpectGetIndexOverloaded.
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.)
ExpectGetIndexAndThrowOverloaded.
ExpectRemoveEventOverloaded.
ExpectSetOverloaded.
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.)
ExpectSetAndThrowOverloaded.
ExpectSetIndexOverloaded.
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.)
ExpectSetIndexAndThrowOverloaded.
ExpectUnmockedCallOverloaded.
ExpectUnmockedConstructorOverloaded.
ExpectUnmockedGetOverloaded.
ExpectUnmockedSetOverloaded.
GetBlock
Retrieve Expectation Block, by its label name
(Inherited from Mock.)
GetCallCountOverloaded.
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.)
StartBlockOverloaded.
StartBlockBeforeOverloaded.
Verify
Verify mocked type
(Inherited from Mock.)
VerifyWithTimeoutOverloaded.

Properties

  NameDescription
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

Remarks

In most cases there is no need to use this method as Typemock Isolator will mock all static methods of the mocked type. CallStatic should be used when an instance method and a static method have the same name By default the instance methods are returned.
If instance methods are mocked
(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

  NameDescription
MockMethodCalled
Event that is fired after a mocked method is called and after argument validation is performed MockMethodCalledEventHandler
(Inherited from Mock.)

See Also