@@ -39,10 +39,10 @@ public void ParseLengthToMetersUsEnglish(string s, double expected)
39
39
[ InlineData ( "1 kg" , typeof ( FormatException ) ) ] // Wrong measurement type.
40
40
[ InlineData ( "1ft monkey 1in" , typeof ( FormatException ) ) ] // Invalid separator between two valid measurements.
41
41
[ 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 )
43
43
{
44
44
var usEnglish = CultureInfo . GetCultureInfo ( "en-US" ) ;
45
- Assert . Throws ( expectedExceptionType , ( ) => Length . Parse ( s , usEnglish ) ) ;
45
+ Assert . Throws ( expectedExceptionType , ( ) => Length . Parse ( s ! , usEnglish ) ) ;
46
46
}
47
47
48
48
/// <exception cref="UnitsNetException">Error parsing string.</exception>
@@ -125,10 +125,10 @@ public void ParseLengthUnitUsEnglish(string s, LengthUnit expected)
125
125
[ Theory ]
126
126
[ InlineData ( "kg" , typeof ( UnitNotFoundException ) ) ]
127
127
[ InlineData ( null , typeof ( ArgumentNullException ) ) ]
128
- public void ParseLengthUnitUsEnglish_ThrowsExceptionOnInvalidString ( string s , Type expectedExceptionType )
128
+ public void ParseLengthUnitUsEnglish_ThrowsExceptionOnInvalidString ( string ? s , Type expectedExceptionType )
129
129
{
130
130
var usEnglish = CultureInfo . GetCultureInfo ( "en-US" ) ;
131
- Assert . Throws ( expectedExceptionType , ( ) => Length . ParseUnit ( s , usEnglish ) ) ;
131
+ Assert . Throws ( expectedExceptionType , ( ) => Length . ParseUnit ( s ! , usEnglish ) ) ;
132
132
}
133
133
134
134
[ Theory ]
@@ -137,7 +137,7 @@ public void ParseLengthUnitUsEnglish_ThrowsExceptionOnInvalidString(string s, Ty
137
137
[ InlineData ( "2 kg" , false ) ]
138
138
[ InlineData ( null , false ) ]
139
139
[ InlineData ( "foo" , false ) ]
140
- public void TryParseLengthUnitUsEnglish ( string s , bool expected )
140
+ public void TryParseLengthUnitUsEnglish ( string ? s , bool expected )
141
141
{
142
142
CultureInfo usEnglish = CultureInfo . GetCultureInfo ( "en-US" ) ;
143
143
bool actual = Length . TryParse ( s , usEnglish , out Length _ ) ;
0 commit comments