@@ -39,10 +39,10 @@ public void ParseLengthToMetersUsEnglish(string s, double expected)
3939 [ InlineData ( "1 kg" , typeof ( FormatException ) ) ] // Wrong measurement type.
4040 [ InlineData ( "1ft monkey 1in" , typeof ( FormatException ) ) ] // Invalid separator between two valid measurements.
4141 [ InlineData ( "1ft 1invalid" , typeof ( FormatException ) ) ] // Valid
42- public void ParseLength_InvalidString_USEnglish_ThrowsException ( string s , Type expectedExceptionType )
42+ public void ParseLength_InvalidString_USEnglish_ThrowsException ( string ? s , Type expectedExceptionType )
4343 {
4444 var usEnglish = CultureInfo . GetCultureInfo ( "en-US" ) ;
45- Assert . Throws ( expectedExceptionType , ( ) => Length . Parse ( s , usEnglish ) ) ;
45+ Assert . Throws ( expectedExceptionType , ( ) => Length . Parse ( s ! , usEnglish ) ) ;
4646 }
4747
4848 /// <exception cref="UnitsNetException">Error parsing string.</exception>
@@ -125,10 +125,10 @@ public void ParseLengthUnitUsEnglish(string s, LengthUnit expected)
125125 [ Theory ]
126126 [ InlineData ( "kg" , typeof ( UnitNotFoundException ) ) ]
127127 [ InlineData ( null , typeof ( ArgumentNullException ) ) ]
128- public void ParseLengthUnitUsEnglish_ThrowsExceptionOnInvalidString ( string s , Type expectedExceptionType )
128+ public void ParseLengthUnitUsEnglish_ThrowsExceptionOnInvalidString ( string ? s , Type expectedExceptionType )
129129 {
130130 var usEnglish = CultureInfo . GetCultureInfo ( "en-US" ) ;
131- Assert . Throws ( expectedExceptionType , ( ) => Length . ParseUnit ( s , usEnglish ) ) ;
131+ Assert . Throws ( expectedExceptionType , ( ) => Length . ParseUnit ( s ! , usEnglish ) ) ;
132132 }
133133
134134 [ Theory ]
@@ -137,7 +137,7 @@ public void ParseLengthUnitUsEnglish_ThrowsExceptionOnInvalidString(string s, Ty
137137 [ InlineData ( "2 kg" , false ) ]
138138 [ InlineData ( null , false ) ]
139139 [ InlineData ( "foo" , false ) ]
140- public void TryParseLengthUnitUsEnglish ( string s , bool expected )
140+ public void TryParseLengthUnitUsEnglish ( string ? s , bool expected )
141141 {
142142 CultureInfo usEnglish = CultureInfo . GetCultureInfo ( "en-US" ) ;
143143 bool actual = Length . TryParse ( s , usEnglish , out Length _ ) ;
0 commit comments