Please tell me what those functions do.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
These are framework-based, language-agnostic methods for defining code contracts in .NET. While some languages such as spec# and Delphi Prism have first-class language support for code contracts, this framework-based approach makes it available to all .NET languages. IronRuby, IronPython, F#, VB.NET etc.
Require() is a method-level check on ENTRY, Ensure() is a method-level check on EXIT, and Assert() is a check at whatever point it is called. That is to say that at whatever point of execution these methods apply, the condition which you pass to them will be evaluated. If that condition is not met, an error occurs.