skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Interface IFluentConfig

Interface providing handy methods for setting up mock instance.

Namespace: Telerik.JustMock.Abstraction
Assembly: Telerik.JustMock.dll

Syntax

public interface IFluentConfig

Methods

AddAttributeToProxy(CustomAttributeBuilder)

Add an attribute to the created proxy type.

Declaration
IFluentConfig AddAttributeToProxy(CustomAttributeBuilder attributeBuilder)
Parameters
System.Reflection.Emit.CustomAttributeBuilder attributeBuilder

An attribute builder object containing the attribute.

Returns
IFluentConfig

The fluent configuration.

CallConstructor(Object[])

Invokes the specified non-public constructor.

Declaration
IFluentConfig CallConstructor(object[] args)
Parameters
System.Object[] args

Arguments to be passed to the constructor.

Returns
IFluentConfig

The fluent configuration.

MockConstructor()

Specifies to mock the constructor.

Declaration
IFluentConfig MockConstructor()
Returns
IFluentConfig

The fluent configuration.

SetBehavior(Behavior)

Sets the behavior of the mock object.

Declaration
IFluentConfig SetBehavior(Behavior behavior)
Parameters
Behavior behavior

The mock behavior.

Returns
IFluentConfig

The fluent configuration.

SetInterceptorFilter(Expression<Predicate<MethodInfo>>)

Sets a predicate that will filter whether a dynamic proxy method will be intercepted or not.

Declaration
IFluentConfig SetInterceptorFilter(Expression<Predicate<MethodInfo>> filter)
Parameters
System.Linq.Expressions.Expression<System.Predicate<System.Reflection.MethodInfo>> filter

Returns
IFluentConfig

The fluent configuration.

Remarks

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.

Extension Methods

FluentHelper.Arrange<T, TResult>(T, Expression<Func<T, TResult>>)
FluentHelper.Arrange<T>(T, Expression<Action<T>>)
FluentHelper.ArrangeSet<T>(T, Action<T>)
FluentHelper.ArrangeLike<T>(T, Expression<Func<T, Boolean>>)
FluentHelper.Assert<T, TReturn>(T, Expression<Func<T, TReturn>>, String)
FluentHelper.Assert<T, TReturn>(T, Expression<Func<T, TReturn>>, Occurs, String)
FluentHelper.Assert<T>(T, Expression<Action<T>>, String)
FluentHelper.Assert<T>(T, Expression<Action<T>>, Occurs, String)
FluentHelper.AssertSet<T>(T, Action<T>, String)
FluentHelper.AssertSet<T>(T, Action<T>, Occurs, String)
FluentHelper.Raise<T>(T, Action<T>, EventArgs)
FluentHelper.Raise<T>(T, Action<T>, Object[])
FluentHelper.Assert<T>(T, String)
FluentHelper.AssertAll<T>(T, String)
Getting Started
  • Unit Testing and Mocking Explained
  • Videos
  • FAQs
Community
  • Forums
  • Blogs
  • Feedback Portal

Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.