I ve just started using Code contract with .net and I had a Guard clause like this
if (!file.Exists(path)) throw FileNotFoundException();
and replaced it with
Contract.Requires(File.Exists(path));
Note: the original question had a typo and it used to read Contract.Ensures()
I m not sure this is correct, because the contract will be dealing with a IO concern, but nto sure if this is a problem or not.
Basiecally the question is, is there any problem in using Contracts to ensure Io concerns (or external /non unit concerns) Thanks