MSTestExtensions/CombinatorialTestMethodAttribute.cs
/// <summary>
/// Validates that each of the test method parameters have a combinatorial argument attribute.
/// </summary>
/// <param name="testMethod">The test method.</param>
/// <exception cref="Exception">An error is found with the attributes.</exception>
/// <devdoc>
/// The MSTest executor seems to do some special handling for base Exception type, where it
/// will omit the exception type.
/// </devdoc>
Validates that each of the test method parameters have a combinatorial argument attribute.
Validates that each of the test method parameters have a combinatorial argument attribute .
private static void ValidateAttributes(ITestMethod testMethod)
        {
            ParameterInfo[] parameters = testMethod.MethodInfo.GetParameters();
            foreach (var parm in parameters)
            {
                if (parm.GetCustomAttribute<BaseCombinatorialArgumentAttribute>(inherit: true) == null)
                {
                    throw new Exception(
                        $"Parameter {parm.Name} is missing a {nameof(BaseCombinatorialArgumentAttribute)}."
                    );
                }
            }
        }
private static void ValidateAttributes ( ITestMethod testMethod ) { ParameterInfo [ ] parameters = testMethod . MethodInfo . GetParameters ( ) ; foreach ( var parm in parameters ) { if ( parm . GetCustomAttribute < BaseCombinatorialArgumentAttribute > ( inherit : true ) == null ) { throw new Exception ( $" Parameter  { parm . Name }  is missing a  { nameof ( BaseCombinatorialArgumentAttribute ) } . " ) ; } } }
Validates that each of the test method parameters have a combinatorial argument attribute.
Validates that each of the test method parameters have a combinatorial argument attribute .
An error is found with the attributes.
An error is found with the attributes .
testMethod
ITestMethod
The test method.
The test method .
devdoc
The MSTest executor seems to do some special handling for base Exception type, where it
will omit the exception type.
The MSTest executor seems to do some special handling for base Exception type where it will omit the exception type .