I have a unit test that calls a method on an object passing in a string.
One of the first things that the method being called does is to check the string for null or empty.
However, no matter what the value of filePath is, the call to string.IsNullOrEmpty is true. See image below.
Am I missing something here?
EDIT:
Checking for null and string.Empty separately works as expected:
EDIT 2:
I have cleaned the solution, deleted the bin directory via the file system and still, after a rebuild, the debugger shows that the ArgumentNullException should be being thrown, although it actually is not being thrown.
The contents of filePath
are definitely not null (and not empty), so that leaves us with two options:
filePath
, which is empty on nullUpdate
Your question update makes me think the second option (of the above) is the one
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With