@@ -34,7 +34,7 @@ private ComponentParameter(string? name, object? value, bool isCascadingValue)
3434 if ( isCascadingValue && value is null )
3535 throw new ArgumentNullException ( nameof ( value ) , "Cascading values cannot be set to null" ) ;
3636
37- if ( ! isCascadingValue && name is null )
37+ if ( ! isCascadingValue && name is null )
3838 throw new ArgumentNullException ( nameof ( name ) , "A parameters name cannot be set to null" ) ;
3939
4040 Name = name ;
@@ -47,46 +47,45 @@ private ComponentParameter(string? name, object? value, bool isCascadingValue)
4747 /// </summary>
4848 /// <param name="name">Name of the parameter to pass to the component</param>
4949 /// <param name="value">Value or null to pass the component</param>
50- public static ComponentParameter CreateParameter ( string name , object ? value ) => new ComponentParameter ( name , value , false ) ;
50+ public static ComponentParameter CreateParameter ( string name , object ? value )
51+ => new ComponentParameter ( name , value , false ) ;
5152
5253 /// <summary>
5354 /// Create a Cascading Value parameter for a component under test.
5455 /// </summary>
5556 /// <param name="name">A optional name for the cascading value</param>
5657 /// <param name="value">The cascading value</param>
57- public static ComponentParameter CreateCascadingValue ( string ? name , object value ) => new ComponentParameter ( name , value , true ) ;
58+ public static ComponentParameter CreateCascadingValue ( string ? name , object value )
59+ => new ComponentParameter ( name , value , true ) ;
5860
5961 /// <summary>
6062 /// Create a parameter for a component under test.
6163 /// </summary>
6264 /// <param name="input">A name/value pair for the parameter</param>
63- public static implicit operator ComponentParameter ( ( string name , object ? value ) input ) => CreateParameter ( input . name , input . value ) ;
65+ public static implicit operator ComponentParameter ( ( string name , object ? value ) input )
66+ => CreateParameter ( input . name , input . value ) ;
6467
6568 /// <summary>
6669 /// Create a parameter or cascading value for a component under test.
6770 /// </summary>
6871 /// <param name="input">A name/value/isCascadingValue triple for the parameter</param>
69- public static implicit operator ComponentParameter ( ( string ? name , object ? value , bool isCascadingValue ) input ) => new ComponentParameter ( input . name , input . value , input . isCascadingValue ) ;
72+ public static implicit operator ComponentParameter ( ( string ? name , object ? value , bool isCascadingValue ) input )
73+ => new ComponentParameter ( input . name , input . value , input . isCascadingValue ) ;
7074
7175 /// <inheritdoc/>
72- public bool Equals ( ComponentParameter other ) => Name == other . Name && Value == other . Value && IsCascadingValue == other . IsCascadingValue ;
76+ public bool Equals ( ComponentParameter other )
77+ => string . Equals ( Name , other . Name , StringComparison . Ordinal ) && Value == other . Value && IsCascadingValue == other . IsCascadingValue ;
7378
7479 /// <inheritdoc/>
7580 public override bool Equals ( object obj ) => obj is ComponentParameter other && Equals ( other ) ;
7681
7782 /// <inheritdoc/>
78- public override int GetHashCode ( ) => ( Name , Value , IsCascadingValue ) . GetHashCode ( ) ;
83+ public override int GetHashCode ( ) => HashCode . Combine ( Name , Value , IsCascadingValue ) ;
7984
8085 /// <inheritdoc/>
81- public static bool operator == ( ComponentParameter left , ComponentParameter right )
82- {
83- return left . Equals ( right ) ;
84- }
86+ public static bool operator == ( ComponentParameter left , ComponentParameter right ) => left . Equals ( right ) ;
8587
8688 /// <inheritdoc/>
87- public static bool operator != ( ComponentParameter left , ComponentParameter right )
88- {
89- return ! ( left == right ) ;
90- }
89+ public static bool operator != ( ComponentParameter left , ComponentParameter right ) => ! ( left == right ) ;
9190 }
9291}
0 commit comments