PropertyBag.Single<TProperty> Method

Definition

Returns the only property of the TProperty type, and throws an exception if there is not exactly one element.

public TProperty Single<TProperty>() where TProperty : Microsoft.Testing.Platform.Extensions.Messages.IProperty;
member this.Single : unit -> 'Property (requires 'Property :> Microsoft.Testing.Platform.Extensions.Messages.IProperty)
Public Function Single(Of TProperty As IProperty) () As TProperty

Type Parameters

TProperty

The type of the property.

Returns

TProperty

The single property of the given type.

Exceptions

Thrown when not exactly one property of the given type was found.

Applies to