- Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
Converting
Contract.Requires<ArgumentException>(expression, message); yields this when executing the tool with the Convert option:
if (expression) { throw new ArgumentException("parameter", "message"); } But the string,string constructor for ArgumentException is the opposite, the correct generated line should be:
if (expression) { throw new ArgumentException("message", "parameter"); } In the case where ArgumentNullException is used instead of ArgumentException it is correct as that order happens to be the inverse. I am guessing it was 2 different developers that wrote those 2 classes a long time ago
Thanks for your time in writing this extension/package and it is a shame Code Contracts never really took off (IMO).
Metadata
Metadata
Assignees
Labels
No labels