The bind attribute overrides the default binding rules for a test parameter by specifying a different data source, a binding path or an index.

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

Syntax

C#
public class BindAttribute : TestParameterDecoratorPatternAttribute
Visual Basic (Declaration)
Public Class BindAttribute _
	Inherits TestParameterDecoratorPatternAttribute

Remarks

At most one such attribute may appear on any given test parameter.

The bind attribute supports more complex data binding binding scenarios. For example, in a typical use of CsvDataAttribute, the binding of test parameters to CSV columns is performed by name and by position. This assumes that the CSV file either contains a header with columns that are named the same as the test parameter or that the columns appear in the same order as the test parameters. Should this not be the case, we may apply the BindAttribute to the test parameter to specify an explicit column name (by setting the path) or column position (by setting the index).

Inheritance Hierarchy

See Also