- Overview
- Guides
- Concepts
- Considerations And Constraints
- Absolute File References
- Assembly Colocation Assumptions
- Concurrent Use Of Test Resources
- Cross Application Domain Testing
- Heavily Executed Code Under Test
- Implicit File Dependencies
- Multi Threaded Tests
- Netstandard Test Projects
- Project Atomicity
- Project Build Platform And Configuration
- Rdi Data Point Location
- Test Atomicity
- Unique Test Names
- Using NCrunch With Source Control
- Reference
- Global Configuration
- Overview
- Auto Adjust Clashing Marker Colours
- Build Log Verbosity
- Build Process Memory Limit
- Capabilities Of This Computer
- Coverage Marker Style
- Cpu Cores Assigned To NCrunch Or Ide
- Custom Environment Variables
- Disable Global Hotkey
- Engine Hosting Strategy
- Fast Lane Threads
- Fast Lane Threshold
- Grid Maximum Reconnection Attempts
- Grid Reconnection Delay
- Impact Detection Mode
- Listening Port
- Log To Output Window
- Logging Verbosity
- Marker Colours
- Max Failing Test Trace Log Size
- Max Number Of Processing Threads
- Max Passing Test Trace Log Size
- Max Test Runners To Pool
- NCrunch Tool Window Colors
- Node Id (Name)
- Password
- Performance Aggregation Type
- Performance Display Sensitivity
- Pipeline Optimisation Priority
- Rdi Storage Settings
- Sliding Build Delay
- Snapshot Storage Directory
- Solution Storage Data Limit
- Spinner Colours
- Terminate Test Runners On Complete
- Test Process Memory Limit
- Tests To Execute On This Machine
- Text Output Font
- Workspace Base Path
- Solution Configuration
- Overview
- Additional Files For Grid Processing
- Additional Files To Include
- Allow Parallel Test Execution
- Allow Tests In Parallel With Themselves
- Infer Project References Using Assembly
- Instrumentation Mode
- NCrunch Cache Storage Path
- Only Consider Tests Outofdate If Impacted
- Project Config File Storage Path
- Show Coverage For Tests
- Show Metrics For Tests
- Tests To Execute Automatically
- Project Configuration
- Overview
- Additional Files To Include
- Allow Dynamic Code Contract Checks
- Allow Static Code Contract Checks
- Analyse Line Execution Times
- Autodetect Nuget Build Dependencies
- Build Priority
- Build Process Cpu Architecture
- Build Sdk
- Collect Control Flow During Execution
- Consider Inconclusive Tests As Passing
- Copied Project Dependencies
- Copy Referenced Assemblies To Workspace
- Custom Build Properties
- Data Storage File Size
- Default Test Timeout
- Detect Stack Overflow
- Enable Rdi
- Files Excluded From Auto Build
- Framework Utilisation Types
- Ignore This Component Completely
- Implicit Project Dependencies
- Include Static References In Workspace
- Instrument Output Assembly
- Method Data Limit
- Ms Test Thread Apartment State
- Preload Assembly References
- Prevent Signing Of Assembly
- Proxy Process File Path
- Rdi Cache Size
- Required Capabilities
- Restrict Tostring Usage
- Run Pre Or Post Build Events
- String Length Limit
- Track File Dependencies
- Use Build Configuration
- Use Build Platform
- Use Cpu Architecture
- Runtime Framework
- Overview
- Atomic Attribute
- Category Attribute
- Collect Control Flow Attribute
- Distribute By Capabilities
- Duplicate By Dimensions
- Enable Rdi Attribute
- Environment Class
- Exclusively Uses Attribute
- Inclusively Uses Attribute
- Isolated Attribute
- Method Data Limit Attribute
- Requires Capability Attribute
- Restrict Tostring Attribute
- Serial Attribute
- String Length Limit Attribute
- Timeout Attribute
- Uses Threads Attribute
- Global Configuration
- Troubleshooting
- Tools
- Keyboard Shortcuts
- Manual Installation Instructions
NCrunch Runtime Framework
The NCrunch Framework assembly is a .DLL file shipped with NCrunch.
The NCrunch.Framework.dll file is loaded into the GAC when NCrunch is installed. It's recommended that you copy this file into your project and reference it from there. Doing so will prevent your build from breaking for anyone that isn't using NCrunch. Note that using NCrunch.Framework.dll is not required for running NCrunch - it is simply used for unlocking some of the more advanced features (such as parallel execution).
The normal location of this file within the GAC is windows\assembly\GAC_MSIL\NCrunch.Framework\VERSION. You may need to open this location using a command prompt to access the file (Windows explorer will present a 'friendly' view instead).
NCrunch.Framework can also be installed using Nuget. When loading NCrunch.Framework from Nuget, ensure you are using a version of NCrunch that is consistent with this binary.
When you have established a reference to the NCrunch.Framework assembly from your test project, you can take advantage of NCrunch's runtime features.
Attributes used by NCrunch from the NCrunch.Framework assembly are not statically referenced by the NCrunch engine. This means it is possible for you to construct your own attributes under the same name and namespace as the existing attributes, and NCrunch will consider them as though they were inside the NCrunch.Framework assembly. This is a useful way to introduce NCrunch to a solution without needing to include a reference to the NCrunch.Framework assembly.
Most of these attributes can also be applied at assembly level, in which case NCrunch will behave as though they are applied to all test fixtures within the assembly.
Framework Assembly ContentsAtomicAttribute | Marks a test fixture as atomic. All child tests in an atomic fixture must be run in the same processing task and cannot be targeted for separate execution. |
CategoryAttribute | Used to help with categorising tests. As not all test frameworks support categorisation at both fixture and method level, this attribute can sometimes be useful as an alternative to framework-specific attributes. |
CollectControlFlowAttribute | Controls whether a test should have its control flow data collected and reported by RDI. |
DistributeByCapabilitiesAttribute | Creates several copies of a test internally, each with a different capability assigned to it. This can be used for multi-platform testing using distributed processing. |
DuplicateByDimensionsAttribute | Creates several copies of a test internally, each with a different dimension. Dimensions can be accessed at run time for different behaviour. This allows several variants of a test, fixture or entire suite to be easily created with a single attribute. |
EnableRdiAttribute | Enables or disables NCrunch RDI for a test, fixture or assembly. |
ExclusivelyUsesAttribute | Used to mark tests or fixtures that make exclusive use of a resource or set of resources (useful when making use of parallel execution). |
InclusivelyUsesAttribute | As above, though this will mark inclusive use rather than exclusive use. |
IsolatedAttribute | Used to mark tests or fixtures that need to be executed in a separate task runner process (i.e. if they are sequence or state dependent). |
MethodDataLimitAttribute | Controls RDI's method data limit for a test, fixture or assembly. |
NCrunchEnvironment | A static class that contains a series of methods to help a test get more information about its execution environment. |
RequiresCapabilityAttribute | This attribute is used to declare capabilities that are required to exist on a computer before it is allowed to run a test. |
RestrictToStringAttribute | Controls whether RDI should restrict its calls to ToString methods for a test, fixture or assembly. |
SerialAttribute | When adorned with this attribute, tests (or fixtures) will never be executed concurrently with other tests by NCrunch. This is equivalent to marking these tests with an ExclusivelyUsesAttribute that shares the same resource as an InclusivelyUsesAttribute applied to all other tests in the solution. |
StringLengthLimitAttribute | Controls RDI's string length limit for a test, fixture or assembly. |
TimeoutAttribute | Used to give tests or fixtures a non-default timeout value. This can be used for test frameworks that do not have such an attribute themselves (such as MSpec). |
UsesThreadsAttribute | Specifies how many cores/threads a test is expected to use. This is used by the engine to avoid overloading systems with multithreaded tests. |