File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,24 @@ public void ToBytes_InputWithoutSuffix_ShouldThrow()
144144
145145 // --- TryParseHumanBytes ---
146146
147+ [ Fact ]
148+ public void TryParseHumanBytes_DefaultOverload_ShouldReturnTrue ( )
149+ {
150+ bool success = "1 KiB" . TryParseHumanBytes ( out long result ) ;
151+
152+ Assert . True ( success ) ;
153+ Assert . Equal ( 1024 , result ) ; // uses default IEC
154+ }
155+
156+ [ Fact ]
157+ public void TryParseHumanBytes_DefaultOverload_ShouldReturnFalseOnInvalid ( )
158+ {
159+ bool success = "invalid" . TryParseHumanBytes ( out long result ) ;
160+
161+ Assert . False ( success ) ;
162+ Assert . Equal ( 0 , result ) ;
163+ }
164+
147165 [ Theory ]
148166 [ InlineData ( "1 MB" , 1000000 , UnitStandard . SI ) ]
149167 [ InlineData ( "1 MiB" , 1048576 , UnitStandard . IEC ) ]
You can’t perform that action at this time.
0 commit comments