Zdieľať cez


Settings waterfall

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The concept of the settings waterfall means that the user can specify settings at the Assembly, Fixture, and Exploration level:

Settings specified at the Assembly level affect all fixtures and exploration under that assembly. Settings specified at the Fixture level affect all explorations under that fixture. Child settings win—if a setting is defined at the Assembly and the Fixture levels, the Fixture settings are used.

Note that some settings are specific to the Assembly level or Fixture level.

Example

using Microsoft.Pex.Framework;

[assembly: PexAssemblySettings(MaxBranches = 1000)] // we override the default value of maxbranches

namespace MyTests
{
    [PexClass(MaxBranches = 500)] // we override the 1000 value and set maxbranches to 500
    public partial class MyTests
    {
        [PexMethod(MaxBranches = 100)] // we override again, maxbranches = 100
        public void MyTest(...) { ... }
    }
}

Got feedback?

Post your ideas and feature requests on Developer Community.