Table of Contents

Struct ComponentParameter

Namespace
Bunit
Assembly
Bunit.Core.dll

Represents a single parameter supplied to an IComponent component under test.

public readonly struct ComponentParameter : IEquatable<ComponentParameter>
Implements
Inherited Members

Properties

IsCascadingValue

Gets a value indicating whether the parameter is for use by a CascadingValue<TValue>.

public bool IsCascadingValue { get; }

Property Value

bool

Name

Gets the name of the parameter. Can be null if the parameter is for an unnamed cascading value.

public string? Name { get; }

Property Value

string

Value

Gets the value being supplied to the component.

public object? Value { get; }

Property Value

object

Methods

CreateCascadingValue(string?, object)

Create a Cascading Value parameter for a component under test.

public static ComponentParameter CreateCascadingValue(string? name, object value)

Parameters

name string

A optional name for the cascading value.

value object

The cascading value.

Returns

ComponentParameter

The created ComponentParameter.

CreateParameter(string, object?)

Create a parameter for a component under test.

public static ComponentParameter CreateParameter(string name, object? value)

Parameters

name string

Name of the parameter to pass to the component.

value object

Value or null to pass the component.

Returns

ComponentParameter

The created ComponentParameter.

Equals(ComponentParameter)

public bool Equals(ComponentParameter other)

Parameters

other ComponentParameter

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Operators

operator ==(ComponentParameter, ComponentParameter)

Verify whether the left and right ComponentParameter are equal.

public static bool operator ==(ComponentParameter left, ComponentParameter right)

Parameters

left ComponentParameter
right ComponentParameter

Returns

bool

implicit operator ComponentParameter((string? Name, object? Value, bool IsCascadingValue))

Create a parameter or cascading value for a component under test.

public static implicit operator ComponentParameter((string? Name, object? Value, bool IsCascadingValue) input)

Parameters

input (string Name, object Value, bool IsCascadingValue)

A name/value/isCascadingValue triple for the parameter.

Returns

ComponentParameter

The created ComponentParameter.

implicit operator ComponentParameter((string Name, object? Value))

Create a parameter for a component under test.

public static implicit operator ComponentParameter((string Name, object? Value) input)

Parameters

input (string Name, object Value)

A name/value pair for the parameter.

Returns

ComponentParameter

The created ComponentParameter.

operator !=(ComponentParameter, ComponentParameter)

Verify whether the left and right ComponentParameter are not equal.

public static bool operator !=(ComponentParameter left, ComponentParameter right)

Parameters

left ComponentParameter
right ComponentParameter

Returns

bool
Progress Telerik

Premium sponsor: Progress Telerik.

Packt

Editorial support provided by Packt.

.NET Foundation

Supported by the .NET Foundation.