Strings are reference types and as such, they can have the value
null. If you have a method which accepts a string as its parameter, would you check the parameter for null or empty string and throw an
ArgumentException instance if you expect a valid string instance to be passed into it?
If it's not exposed as an API I wouldn't, it's pretty tedious for me since i expect all calls for the said method to pass a valid string instance since i trust my code. Of course, i wouldn't have a unit test for it with an ArgumentException expectation for null and empty string which i now view as an overkill.
Posted
07-19-2006 10:31 PM
by
jokiz