Skip to content

Instantly share code, notes, and snippets.

@dariusz-wozniak
Created September 7, 2014 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dariusz-wozniak/45d72f78bccb9d57e5af to your computer and use it in GitHub Desktop.
Save dariusz-wozniak/45d72f78bccb9d57e5af to your computer and use it in GitHub Desktop.
Code Contracts: Contract.Requires
public int Add(int a, int b)
{
Contract.Requires<ArgumentOutOfRangeException>(a >= 0);
Contract.Requires<ArgumentOutOfRangeException>(b >= 0);
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment