Telerik® JustMock™ by Progress

The Mock type exposes the following members.

Methods

  NameDescription
Public methodStatic memberArrange(Expression<(Of <<'(Action>)>>))
Setups the target call to act in a specific way.
Public methodStatic memberArrange<(Of <<'(TResult>)>>)(Expression<(Of <<'(Func<(Of <(<'TResult>)>)>>)>>))
Public methodStatic memberArrange<(Of <<'(T>)>>)(T, Action<(Of <<'(T>)>>))
Setups the target mock call with user expectation.
Public methodStatic memberArrange<(Of <<'(T, TResult>)>>)(Func<(Of <(<'TResult>)>)>)
Public methodStatic memberArrange<(Of <<'(T, TResult>)>>)(T, Func<(Of <(<'T, TResult>)>)>)
Public methodStatic memberArrangeLike<(Of <<'(T>)>>)
Public methodStatic memberArrangeSet
Setups target property set operation to act in a specific way.

Examples

CopyC#
Mock.ArrangeSet(() => foo.MyValue = 10).Throws(new InvalidOperationException());
This will throw InvalidOperationException for when foo.MyValue is set with 10.
Public methodStatic memberAssert(Expression<(Of <<'(Action>)>>), String)
Asserts a specific call from expression.
Public methodStatic memberAssert(Type, String)
Asserts all expectation on the given type
Public methodStatic memberAssert(Expression<(Of <<'(Action>)>>), Args, String)
Asserts the specified call from expression.
Public methodStatic memberAssert(Expression<(Of <<'(Action>)>>), Occurs, String)
Asserts the specified call from expression.
Public methodStatic memberAssert(Expression<(Of <<'(Action>)>>), Args, Occurs, String)
Asserts the specified call from expression.
Public methodStatic memberAssert<(Of <<'(T>)>>)(String)
Asserts all expectation on the given type
Public methodStatic memberAssert<(Of <<'(TReturn>)>>)(Expression<(Of <<'(Func<(Of <(<'TResult>)>)>>)>>), Void)
Public methodStatic memberAssert<(Of <<'(T>)>>)(T, String)
Asserts all expected calls that are marked as must or to be occurred a certain number of times.
Public methodStatic memberAssert<(Of <<'(TReturn>)>>)(Expression<(Of <<'(Func<(Of <(<'TResult>)>)>>)>>), Void, TReturn)
Public methodStatic memberAssert<(Of <<'(TReturn>)>>)(Expression<(Of <<'(Func<(Of <(<'TResult>)>)>>)>>), Void, TReturn, Args)
Public methodStatic memberAssert<(Of <<'(T, TResult>)>>)(T, Func<(Of <(<'T, TResult>)>)>, Boolean)
Public methodStatic memberAssert<(Of <<'(T, TResult>)>>)(T, Func<(Of <(<'T, TResult>)>)>, Boolean, T)
Public methodStatic memberAssertAll<(Of <<'(T>)>>)
Asserts all expected setups.
Public methodStatic memberAssertSet(Action, String)
Asserts the specific property set operation.
Public methodStatic memberAssertSet(Action, Args, String)
Asserts the specific property set operation.
Public methodStatic memberAssertSet(Action, Occurs, String)
Asserts the specific property set operation.
Public methodStatic memberAssertSet(Action, Args, Occurs, String)
Asserts the specific property set operation.
Public methodStatic memberCreate(String)
Creates a mocked instance from a internal class with RecursiveLoose behavior.
Public methodStatic memberCreate(Type)
Creates a mocked instance from a given type with RecursiveLoose behavior.
Public methodStatic memberCreate(String, Action<(Of <<'(IFluentConfig>)>>))
Creates a mocked instance from an internal class.
Public methodStatic memberCreate(String, Behavior)
Creates a mocked instance from an internal class.
Public methodStatic memberCreate(Type, Action<(Of <<'(IFluentConfig>)>>))
Creates a mocked instance from a given type.
Public methodStatic memberCreate(Type, array<Object>[]()[][])
Creates a mocked instance from a given type with RecursiveLoose behavior.
Public methodStatic memberCreate(Type, Behavior)
Creates a mock instance from a given type.
Public methodStatic memberCreate(Type, Behavior, array<Object>[]()[][])
Creates a mock instance from a given type.
Public methodStatic memberCreate(Type, Constructor, Behavior)
Creates a mocked instance from a given type.
Public methodStatic memberCreate<(Of <<'(T>)>>)()()()()
Creates a mocked instance from a given type with RecursiveLoose behavior.
Public methodStatic memberCreate<(Of <<'(T>)>>)(Action<(Of <<'(IFluentConfig<(Of <<'(T>)>>)>)>>))
Creates a mocked instance from settings specified in the lambda.
Public methodStatic memberCreate<(Of <<'(T>)>>)(Expression<(Of <<'(Func<(Of <(<'TResult>)>)>>)>>))
Public methodStatic memberCreate<(Of <<'(T>)>>)(array<Object>[]()[][])
Creates a mocked instance from a given type with RecursiveLoose behavior.
Public methodStatic memberCreate<(Of <<'(T>)>>)(Behavior)
Creates a mocked instance from a given type.
Public methodStatic memberCreate<(Of <<'(T>)>>)(Constructor)
Creates a mocked instance from a given type with RecursiveLoose behavior.
Public methodStatic memberCreate<(Of <<'(T>)>>)(Expression<(Of <<'(Func<(Of <(<'TResult>)>)>>)>>), Void)
Public methodStatic memberCreate<(Of <<'(T>)>>)(Behavior, array<Object>[]()[][])
Creates a mocked instance from a given type.
Public methodStatic memberCreate<(Of <<'(T>)>>)(Constructor, Behavior)
Creates a mocked instance from a given type.
Public methodStatic memberCreateLike<(Of <<'(T>)>>)
Public methodStatic memberGetTimesCalled(Expression<(Of <<'(Action>)>>))
Returns the number of times the specified member was called.
Public methodStatic memberGetTimesCalled(Expression<(Of <<'(Action>)>>), Args)
Returns the number of times the specified member was called.
Public methodStatic memberGetTimesCalled<(Of <<'(TReturn>)>>)(Expression<(Of <<'(Func<(Of <(<'TResult>)>)>>)>>))
Public methodStatic memberGetTimesCalled<(Of <<'(TReturn>)>>)(Expression<(Of <<'(Func<(Of <(<'TResult>)>)>>)>>), Void)
Public methodStatic memberGetTimesSetCalled(Action)
Returns the number of times the specified setter or event subscription method was called.
Public methodStatic memberGetTimesSetCalled(Action, Args)
Returns the number of times the specified setter or event subscription method was called.
Public methodStatic memberIntercept(Type)
Explicitly enables the interception of the given type by the profiler. Interception is usually enabled implicitly by calls to Create(Type, array<Object>[]()[][]) or Arrange(Expression<(Of <<'(Action>)>>)). This method is rarely needed in cases where you're trying to arrange setters or raise events on a partial mock.
Public methodStatic memberIntercept<(Of <<'(TTypeToIntercept>)>>)()()()()
Explicitly enables the interception of the given type by the profiler. Interception is usually enabled implicitly by calls to Create(Type, array<Object>[]()[][]) or Arrange(Expression<(Of <<'(Action>)>>)). This method is rarely needed in cases where you're trying to arrange setters or raise events on a partial mock.
Public methodStatic memberRaise
Raises the specified event. If the event is not mocked and is declared on a C# or VB class and has the default implementation for add/remove, then that event can also be raised using this method, even with the profiler off. The type on which the event is defined may need to be pre-intercepted using Intercept(Type) before calling Raise.
Public methodStatic memberReset
Removes all existing arrangements within the current mocking context (e.g. current test method). Arrangements made in parent mocking contexts (e.g. in fixture setup method) are preserved.
Public methodStatic memberSetupStatic(Type)
Setups the target for mocking all static calls.
Public methodStatic memberSetupStatic(Type, Behavior)
Setups the target for mocking all static calls.
Public methodStatic memberSetupStatic(Type, StaticConstructor)
Setups the target for mocking all static calls.
Public methodStatic memberSetupStatic(Type, Behavior, StaticConstructor)
Setups the target for mocking all static calls.
Public methodStatic memberSetupStatic<(Of <<'(T>)>>)()()()()
Setups the target for mocking all static calls with RecursiveLoose behavior.
Public methodStatic memberSetupStatic<(Of <<'(T>)>>)(Behavior)
Setups the target for mocking all static calls.

See Also