Limiting Fakes with During Filters

Top  Previous  Next

With Isolator++ Professional, you can limit fakes so they only apply during specific runtime conditions.

This prevents unintended side effects and makes tests more precise.

 

You can apply During filters at three levels:

·Suite level: Isolator(During(...))
·Instance level: a.Fake.Instance<T>(During(...))
·Call level: a.CallTo(...).During(...)

 

Note: Precedence: Call > Instance > Suite, use IgnoreHigherLevels() to stop broader filters from applying.

 

During filters can be defined with:

·Built-in helpers (e.g., A::Module, A::Thread, A::Call)
·Custom lambdas using DuringContext.
·Combinations across multiple levels for fine-grained control.

 

See More:

Built-In During Filters

Custom During Filters

Combined During Filters

 

During filters can also be defined with Verbose Logging, see more in Combined Filters With Verbose.

 

Note: The During Filters feature is available in the Enterprise license of Isolator++ Professional only.


Copyright  Typemock Ltd. 2009-2025.  All Rights Reserved.