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
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
Value
Gets the value being supplied to the component.
public object? Value { get; }
Property Value
Methods
CreateCascadingValue(string?, object)
Create a Cascading Value parameter for a component under test.
public static ComponentParameter CreateCascadingValue(string? name, object value)
Parameters
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
stringName of the parameter to pass to the component.
value
objectValue or null to pass the component.
Returns
- ComponentParameter
The created ComponentParameter.
Equals(ComponentParameter)
public bool Equals(ComponentParameter other)
Parameters
other
ComponentParameter
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Operators
operator ==(ComponentParameter, ComponentParameter)
Verify whether the left
and right
ComponentParameter are equal.
public static bool operator ==(ComponentParameter left, ComponentParameter right)
Parameters
left
ComponentParameterright
ComponentParameter
Returns
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
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
ComponentParameterright
ComponentParameter