PropertyBag.Single<TProperty> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
The single property of the given type.
Exceptions
Thrown when not exactly one property of the given type was found.