IFluentConfig
Interface providing handy methods for setting up mock instance.
Definition
Namespace:Telerik.JustMock.Abstraction
Assembly:Telerik.JustMock.dll
Syntax:
public interface IFluentConfig
Methods
Add an attribute to the created proxy type.
IFluentConfig AddAttributeToProxy(CustomAttributeBuilder attributeBuilder)
An attribute builder object containing the attribute.
Returns:The fluent configuration.
Invokes the specified non-public constructor.
IFluentConfig CallConstructor(object[] args)
Arguments to be passed to the constructor.
Returns:The fluent configuration.
Specifies to mock the constructor.
Sets the behavior of the mock object.
IFluentConfig SetBehavior(Behavior behavior)
The mock behavior.
Returns:The fluent configuration.
Sets a predicate that will filter whether a dynamic proxy method will be intercepted or not.
IFluentConfig SetInterceptorFilter(Expression<Predicate<MethodInfo>> filter)
The fluent configuration.
Dynamic proxy methods are the methods that proxy calls from interface methods, abstract methods or inherited virtual methods. If a filter is not specified, then, by default, all methods are intercepted. If a method is not intercepted, it cannot be mocked.
The interceptor filter allows you to specify which methods will be intercepted and which won't be. Normally, you'd want to intercept all methods. However, there are practical limitations to the number of members that can be intercepted on a given type. If a type has more than about 5000 interceptable members, then the time needed to generate the proxy type may be impractically long. In those cases specify a filter that will remove from interception those members that you don't intend to mock anyway.