I'm testing some code using System.Diagnostics.Contracts.Contract.Requires and System.Diagnostics.Contracts.Contract.Ensures and while it compiles fine, it appears to do absolutely nothing. I passed parameters to 'Requires' that obviously make the condition false and the code will run as if the 'Requires' call wasn't even there.
I'm using VS 2017 and targeting .NET Framework 4.5.
Example:
private static void one(int i)
{
System.Diagnostics.Contracts.Contract.Requires(i > 0);
}
private static void two(int i)
{
one(0); //the call is being made, but 'Requires' not complaining
}