NCover Filters
NCover filters cannot be created from the command line, but the Filters command allows you to set and modify project parameters from the command line.
Usage
NCover Filters --project=
Bracketed parameters are optional.
Options
--file=value: file containing the filters to add (in JSON format).
--project=value: project to add filters to.
--clear: clear all the filters in the project
The project name is required. If no other options are given, this command will print out a list of the filters for the specified project.
JSON file format:
Here is an example of the JSON to add filters:
{ "filterRules":
{ "include": false, "field": "Method", "condition": "Contains", "value": "MyMethod" }, { "include": true, "field": "Class", "condition": "StartsWith", "value": "MyClass" }] }
This is a JSON object with one property ("filterRules"). That property contains the array of filter rules to add to the project pre-coverage filter.
The options here (include, field, condition, value) are the same options -- though not exactly the same values -- found in the drop-down boxes for the Pre-Coverage Filters in the Project settings:
Include: True, False
Field: Module, Method, Namepace, Assembly, Class
Condition: Contains, StartsWith, EndsWith, Matches, Regex
Value: YourDLL