C# Класс NFluent.Extensibility.FluentMessage

Help to build a properly formatted fluent error message.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
FluentMessage System

Открытые методы

Метод Описание
BuildMessage ( string message ) : FluentMessage

Builds the message.

Expected ( object expected ) : MessageBlock

Adds a message block to describe the expected result.

ExpectedType ( Type expectedType ) : MessageBlock

Adds a message block to describe the expected type.

ExpectedValues ( object expectedValues ) : MessageBlock

Adds a message block to describe the expected values.

For ( Type forcedType ) : FluentMessage

Specifies the type of entities.

For ( string newEntityDescription ) : FluentMessage

Specifies the attribute to use to describe entities.

On ( object test, int index ) : MessageBlock

Adds a block describing the checked objet.

ReferenceValues ( object expected ) : MessageBlock

Adds a message block to describe the expected result.

ToString ( ) : string

Returns a System.String that represents this instance.

WithGivenValue ( object givenValue ) : MessageBlock

Adds a message block to describe the given value (usually used as an alternative to the Expected block).

Приватные методы

Метод Описание
FluentMessage ( string message ) : System

Initializes a new instance of the FluentMessage class.

You can use {x} as place holders for standard wordings: - {0}.

Описание методов

BuildMessage() публичный статический Метод

Builds the message.
public static BuildMessage ( string message ) : FluentMessage
message string The message.
Результат FluentMessage

Expected() публичный Метод

Adds a message block to describe the expected result.
public Expected ( object expected ) : MessageBlock
expected object The expected value.
Результат MessageBlock

ExpectedType() публичный Метод

Adds a message block to describe the expected type.
public ExpectedType ( Type expectedType ) : MessageBlock
expectedType System.Type The expected type.
Результат MessageBlock

ExpectedValues() публичный Метод

Adds a message block to describe the expected values.
public ExpectedValues ( object expectedValues ) : MessageBlock
expectedValues object The expected values.
Результат MessageBlock

For() публичный Метод

Specifies the type of entities.
public For ( Type forcedType ) : FluentMessage
forcedType System.Type The type of the Entity.
Результат FluentMessage

For() публичный Метод

Specifies the attribute to use to describe entities.
public For ( string newEntityDescription ) : FluentMessage
newEntityDescription string The new description for the Entity.
Результат FluentMessage

On() публичный Метод

Adds a block describing the checked objet.
public On ( object test, int index ) : MessageBlock
test object The tested object/value.
index int The interesting index (for enumerable types)
Результат MessageBlock

ReferenceValues() публичный Метод

Adds a message block to describe the expected result.
public ReferenceValues ( object expected ) : MessageBlock
expected object The expected value.
Результат MessageBlock

ToString() публичный Метод

Returns a System.String that represents this instance.
public ToString ( ) : string
Результат string

WithGivenValue() публичный Метод

Adds a message block to describe the given value (usually used as an alternative to the Expected block).
public WithGivenValue ( object givenValue ) : MessageBlock
givenValue object The given value.
Результат MessageBlock