Table of Contents

Class CapturedParameterView<TComponent>

Namespace
Bunit.TestDoubles
Assembly
Bunit.Web.dll

Represents a view of parameters captured by a ComponentDoubleBase<TComponent>.

public class CapturedParameterView<TComponent> : IReadOnlyDictionary<string, object>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable where TComponent : IComponent

Type Parameters

TComponent
Inheritance
CapturedParameterView<TComponent>
Implements
Inherited Members
Extension Methods

Properties

Count

public int Count { get; }

Property Value

int

Empty

public static CapturedParameterView<TComponent> Empty { get; }

Property Value

CapturedParameterView<TComponent>

this[string]

Gets the value of the parameter with the key.

public object this[string key] { get; }

Parameters

key string

Name of the parameter to get.

Property Value

object

The value of the parameter

Keys

public IEnumerable<string> Keys { get; }

Property Value

IEnumerable<string>

Values

public IEnumerable<object> Values { get; }

Property Value

IEnumerable<object>

Methods

ContainsKey(string)

public bool ContainsKey(string key)

Parameters

key string

Returns

bool

From(ParameterView)

Create an instances of the CapturedParameterView<TComponent> from the parameters ParameterView.

public static CapturedParameterView<TComponent> From(ParameterView parameters)

Parameters

parameters ParameterView

Parameters to create from.

Returns

CapturedParameterView<TComponent>

An instance of CapturedParameterView<TComponent>.

GetEnumerator()

public IEnumerator<KeyValuePair<string, object>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<string, object>>

Get<TValue>(Expression<Func<TComponent, TValue>>)

Gets the value of a parameter passed to the captured TComponent, using the parameterSelector.

public TValue Get<TValue>(Expression<Func<TComponent, TValue>> parameterSelector)

Parameters

parameterSelector Expression<Func<TComponent, TValue>>

A parameter selector that selects the parameter property of TComponent.

Returns

TValue

The TValue.

Type Parameters

TValue

The type of the parameter to find.

Exceptions

ArgumentNullException

Thrown when parameterSelector is null.

ArgumentException

Thrown when the member of TComponent selected by the parameterSelector is not a Blazor parameter.

ParameterNotFoundException

Thrown when the selected parameter was not passed to the captured TComponent.

InvalidCastException

Throw when the type of the value passed to the selected parameter is not the same as the selected parameters type, i.e. TValue.

TryGetValue(string, out object)

public bool TryGetValue(string key, out object value)

Parameters

key string
value object

Returns

bool
Progress Telerik

Premium sponsor: Progress Telerik.

Packt

Editorial support provided by Packt.

.NET Foundation

Supported by the .NET Foundation.