Class ProtoKeyValueModel<TModel>

Namespace
ProtoTest.Sheets
Assembly
ProtoTest.Sheets.dll

A sheet modelled as label/value pairs: [Sheet("Summary", Kind = ProtoSheetKind.KeyValue)] names the sheet and [Label("Total")] declares one label per property. Labels are read from the sheet's first column and values from the second; a missing or duplicated label fails the read naming the labels the sheet carries, so tests read typed values without repeating label strings.

public sealed class ProtoKeyValueModel<TModel> where TModel : notnull

Type Parameters

TModel
Inheritance
ProtoKeyValueModel<TModel>
Inherited Members
Extension Methods

Properties

Labels

The labels the sheet carries, in row order.

public IReadOnlyList<string> Labels { get; }

Property Value

IReadOnlyList<string>

Sheet

public ProtoSheet Sheet { get; }

Property Value

ProtoSheet

Should

The assertions of this model, for example Should.MatchModel().

public ProtoKeyValueModelAssertions<TModel> Should { get; }

Property Value

ProtoKeyValueModelAssertions<TModel>

ShouldNot

The negated assertions of this model, for example ShouldNot.MatchModel().

public ProtoKeyValueModelAssertions<TModel> ShouldNot { get; }

Property Value

ProtoKeyValueModelAssertions<TModel>

Methods

Column<TValue>(Expression<Func<TModel, TValue>>)

Reads the value under the label the property declares.

public ProtoKeyValueEntry<TValue> Column<TValue>(Expression<Func<TModel, TValue>> property)

Parameters

property Expression<Func<TModel, TValue>>

Returns

ProtoKeyValueEntry<TValue>

Type Parameters

TValue