Declares that a property, field, method parameter, constructor parameter, generic type parameter or generic method parameter represents a test parameter.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.459.0)

Syntax

C#
public class ParameterAttribute : TestParameterPatternAttribute
Visual Basic (Declaration)
Public Class ParameterAttribute _
	Inherits TestParameterPatternAttribute

Remarks

This attribute is optional for a method parameter, constructor parameter, generic type parameter or generic method parameter. For a property or field, this attribute is required unless the property or field has at least one associated data source, in which case the attribute can be omitted.

In other words, this attribute only needs to be specified on a property or field that does not have an associated explicit data binding attribute. This is typically the case when the parameter obtains its values from a data source defined by the test fixture.

Examples

CopyC#
[Header("Parameter1", "Parameter2")]
[Row(1, "a")]
[Row(2, "b")]
public class Fixture
{
    [Parameter]
    public int Parameter1;

    [Parameter]
    public string Parameter2 { get; set; }
}

Inheritance Hierarchy

See Also