INonPublicExpectation
Defines methods to mock non-public members.
Definition
Namespace:Telerik.JustMock.Expectations.Abstraction
Assembly:Telerik.JustMock.dll
Syntax:
public interface INonPublicExpectation
Properties
Non public ref return interface for mocking.
INonPublicRefReturnExpectation RefReturn { get; }
Methods
Arranges an expectation on a void method given using a dynamic wrapper built with Wrap().
ActionExpectation Arrange(dynamic dynamicExpression)
An expression built using a wrapper returned by Wrap.
Returns:An expectation object that can further configure the arrangement
Arranges a method for mocking.
ActionExpectation Arrange(MethodBase method, params object[] args)
Target method
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:Setups a non-public method for mocking.
ActionExpectation Arrange(object target, MethodInfo method, params object[] args)
Target instance
methodMethodInfoMethod to setup taken from reflection.
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:Reference to setup actions calls
Arranges a method for mocking.
ActionExpectation Arrange(object target, string memberName, Type[] typeArguments, params object[] args)
Target instance
memberNamestringMember name
typeArgumentsType[]Generic type arguments of the member specified by memberName
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:Reference to setup actions calls
Arranges a method for mocking.
ActionExpectation Arrange(Type targetType, string memberName, Type[] typeArguments, params object[] args)
Target type
memberNamestringTarget member name
typeArgumentsType[]Generic type arguments of the member specified by memberName
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:Arranges a method for mocking.
FuncExpectation<TReturn> Arrange<T, TReturn>(string memberName, params object[] args)
Target member name
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:FuncExpectation<TReturn>
Arranges a method for mocking.
FuncExpectation<TReturn> Arrange<T, TReturn>(string memberName, Type[] typeArguments, params object[] args)
Target member name
typeArgumentsType[]Generic type arguments of the member specified by memberName
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:FuncExpectation<TReturn>
Arranges a method for mocking.
Arranges an expectation on a non-void method given using a dynamic wrapper built with Wrap().
FuncExpectation<TReturn> Arrange<TReturn>(dynamic dynamicExpression)
An expression built using a wrapper returned by Wrap.
Returns:FuncExpectation<TReturn>
An expectation object that can further configure the arrangement
Arranges a method for mocking.
FuncExpectation<TReturn> Arrange<TReturn>(MethodBase method, params object[] args)
Target method
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:FuncExpectation<TReturn>
Setups a non-public method for mocking.
FuncExpectation<TReturn> Arrange<TReturn>(object target, MethodInfo method, params object[] args)
Target instance
methodMethodInfoMethod to setup taken from reflection.
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:FuncExpectation<TReturn>
Reference to setup actions calls
Arranges a method for mocking.
FuncExpectation<TReturn> Arrange<TReturn>(object target, string memberName, params object[] args)
Target instance.
memberNamestringTarget member name
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:FuncExpectation<TReturn>
Arranges a method for mocking.
FuncExpectation<TReturn> Arrange<TReturn>(object target, string memberName, Type[] typeArguments, params object[] args)
Target instance.
memberNamestringTarget member name
typeArgumentsType[]Generic type arguments of the member specified by memberName
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:FuncExpectation<TReturn>
Arranges a method for mocking.
FuncExpectation<TReturn> Arrange<TReturn>(Type targetType, string memberName, params object[] args)
Target type
memberNamestringTarget member name
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:FuncExpectation<TReturn>
Arranges a method for mocking.
FuncExpectation<TReturn> Arrange<TReturn>(Type targetType, string memberName, Type[] typeArguments, params object[] args)
Target type
memberNamestringTarget member name
typeArgumentsType[]Generic type arguments of the member specified by memberName
argsobject[]Method arguments. Use Expr for predefined argument matchers.
Returns:FuncExpectation<TReturn>
Arranges a non-public property setter for mocking.
Arranges a non-public static property setter contained by "type" for mocking.
Arranges a non-public static property setter contained by type parameter "T" for mocking.
Asserts an expectation given using a dynamic wrapper built with Wrap()
void Assert(dynamic dynamicExpression, Args args, Occurs occurs, string message = null)
An expression built using a wrapper returned by Wrap.
argsArgsAdditional arguments to clarify the assertion expression.
occursOccursOccurrence expectation to assert.
messagestringA message to display if the assertion fails.
Asserts an expectation given using a dynamic wrapper built with Wrap()
Asserts the specified method that it is called as expected.
void Assert(MethodBase method, Occurs occurs, params object[] args)
Target method
occursOccursSpecifies the number of times a call should occur.
argsobject[]Method arguments
Asserts the specified method that it is called as expected.
void Assert(MethodBase method, params object[] args)
Target method
argsobject[]Method arguments
Asserts the specified method that it is called as expected.
void Assert(object target, MethodInfo method, Occurs occurs, params object[] args)
Target mock
methodMethodInfoMethod to assert taken from reflection.
occursOccursSpecifies the number of times a call should occur.
argsobject[]Method arguments
Asserts the specified method that it is called as expected.
void Assert(object target, MethodInfo method, params object[] args)
Target mock
methodMethodInfoMethod to assert taken from reflection.
argsobject[]Method arguments
Asserts the specified member that it is called as expected.
Asserts the specified member that it is called as expected.
void Assert(object target, string memberName, Type[] typeArguments, Occurs occurs, params object[] args)
Target mock
memberNamestringName of the member
typeArgumentsType[]Generic type arguments of the member specified by memberName
occursOccursSpecifies the number of times a call should occur.
argsobject[]Method arguments
Asserts the specified member that it is called as expected.
Asserts the specified member that it is called as expected.
Asserts the specified member that it is called as expected.
void Assert(Type targetType, string memberName, Type[] typeArguments, Occurs occurs, params object[] args)
Type of the target
memberNamestringName of the member
typeArgumentsType[]Generic type arguments of the member specified by memberName
occursOccursSpecifies the number of times a call should occur.
argsobject[]Method arguments
Asserts the specified member that it is called as expected.
Asserts the specified member that it is called as expected.
void Assert<T, TReturn>(string memberName, Type[] typeArguments, Occurs occurs, params object[] args)
Name of the member
typeArgumentsType[]Generic type arguments of the member specified by memberName
occursOccursSpecifies the number of times a call should occur.
argsobject[]Method arguments
Asserts the specified member that it is called as expected.
Asserts the specified member that it is called as expected.
void Assert<T>(string memberName, Type[] typeArguments, Occurs occurs, params object[] args)
Name of the member
typeArgumentsType[]Generic type arguments of the member specified by memberName
occursOccursSpecifies the number of times a call should occur.
argsobject[]Method arguments
Asserts the specified member that it is called as expected.
Asserts the specified member that it is called as expected.
void Assert<TReturn>(object target, string memberName, Type[] typeArguments, Occurs occurs, params object[] args)
Target mock
memberNamestringName of the member
typeArgumentsType[]Generic type arguments of the member specified by memberName
occursOccursSpecifies the number of times a call should occur.
argsobject[]Method arguments
Asserts the specified member that it is called as expected.
Asserts the specified member that it is called as expected.
void Assert<TReturn>(Type targetType, string memberName, Type[] typeArguments, Occurs occurs, params object[] args)
Type of the target
memberNamestringName of the member
typeArgumentsType[]Generic type arguments of the member specified by memberName
occursOccursSpecifies the number of times a call should occur.
argsobject[]Method arguments
Asserts the specified member that it is called as expected.
Returns the number of times the specified member was called.
int GetTimesCalled(MethodBase method, params object[] args)
Target method
argsobject[]Method arguments
Returns:Number of calls.
Returns the number of times the specified member was called.
int GetTimesCalled(object target, MethodInfo method, params object[] args)
Target mock
methodMethodInfoMethod taken from reflection
argsobject[]Method arguments
Returns:Number of calls.
Returns the number of times the specified member was called.
int GetTimesCalled(object target, string memberName, Type[] typeArguments, params object[] args)
Target mock
memberNamestringName of the member
typeArgumentsType[]Generic type arguments of the member specified by memberName
argsobject[]Method arguments
Returns:Number of calls.
Returns the number of times the specified member was called.
Creates an accessor object that can invoke non-public methods and get/set non-public properties and fields.
Equivalent to
new PrivateAccessor(instance)
.
PrivateAccessor MakePrivateAccessor(object instance)
Instance to which non-public access will be given.
Returns:Non-public accessor.
Creates an accessor object that can invoke static (Shared in Visual Basic) non-public methods and static get/set non-public properties and fields.
Equivalent to
PrivateAccessor.ForType(type)
.
PrivateAccessor MakeStaticPrivateAccessor(Type type)
Type whose static members will be given non-public access to.
Returns:Non-public accessor.
Raises a static event specified using reflection. If the event 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.
Raises an event specified using reflection. If the event 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.
Raises an event by name. If the event 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.
Raises a static event by name. If the event 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.
Returns a dynamic wrapper of the given object that can be used to arrange non-public instance members on the object.
dynamic Wrap(object instance)
The object to wrap.
Returns:dynamic
A wrapper that can be passed to Arrange.
Returns a dynamic wrapper of the given type that can be used to arrange non-public static members on the type.
dynamic WrapType(Type type)
The type to wrap.
Returns:dynamic
A wrapper that can be passed to Arrange.