Specification.

Cast<T, TCast>(ISpecification<TCast>) Method

Summary

Creates CastSpecification<T, TCast>:

Converts Specification (candidate to verification) from T to TCast.

Namespace
FluentSpecification
Containing Type
Specification

Syntax

[PublicAPI]
[NotNull]
public static IComplexSpecification<T> Cast<T, TCast>(ISpecification<TCast> specification)

Attributes

Type Description
PublicAPI
NotNull

Type Parameters

Name Description
T Type of candidate to verify.
TCast Type of candidate to verify after cast.

Parameters

Name Type Description
specification ISpecification<TCast> Specification to convert.

Return Value

Type Description
IComplexSpecification<T> Composed complex Specification.

Exceptions

Type Description
System.ArgumentNullException Thrown when specification is null.
System.InvalidOperationException Thrown when there is no conversion between T and TCast.
GitHub