Class LabelAttribute

Namespace
ProtoTest.Sheets
Assembly
ProtoTest.Sheets.dll

Binds one key-value model property to a label, for example [Label("Total")]. The label must appear exactly once in the sheet's first column; the value under it is read from the second column. A table model declares its columns with ColumnAttribute instead.

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Parameter)]
public sealed class LabelAttribute : Attribute
Inheritance
LabelAttribute
Inherited Members
Extension Methods

Constructors

LabelAttribute(string)

Binds one key-value model property to a label, for example [Label("Total")]. The label must appear exactly once in the sheet's first column; the value under it is read from the second column. A table model declares its columns with ColumnAttribute instead.

public LabelAttribute(string label)

Parameters

label string

Properties

Label

The label text the sheet carries.

public string Label { get; }

Property Value

string

Max

Largest allowed number; the default means no maximum.

public double Max { get; init; }

Property Value

double

Min

Smallest allowed number; the default means no minimum.

public double Min { get; init; }

Property Value

double

OneOf

The only rendered values allowed.

public string[]? OneOf { get; init; }

Property Value

string[]

Optional

When true an empty value is fine; the property then needs a nullable type.

public bool Optional { get; init; }

Property Value

bool

Pattern

Regular expression the value's rendered text must match.

public string? Pattern { get; init; }

Property Value

string