Codecontracts

Contract.Requires(quantity > 0);
Contract.Requires(text != null && text.Length > 1 && text.All(c => Char.IsLetter(c)));

Contract.Ensures(result > 0);

Contract.Assumes(myObject != null);

[ContractForType(IMyInterface)]
public class MyInterfaceContract
{
public void MyMethod()
{

}
}

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License