Top "Code-contracts" questions

Code Contracts is a Microsoft open source project which allows you to express pre-conditions, post-conditions, and assertions directly in code.

Programming by contracts in PHP

Programming by contracts is a modern trend in .NET, but what about libraries/frameworks for code contracts in PHP? What …

php design-patterns code-contracts design-by-contract
Code contracts - Assume vs Requires

What's the diference between these two statements ? Contract.Requires(string.IsNullOrWhiteSpace(userName)); Contract.Assume(string.IsNullOrWhiteSpace(userName));

.net-4.0 code-contracts
Question about [Pure] methods

Is the following method Pure? I'd say so, as it doesn't change in anyway the current class, thus, everything we …

c# code-contracts
Code Contracts in C# and null checking

In my code i do this a lot: myfunction (parameter p) { if(p == null) return; } How would I replace this …

c# c#-4.0 code-contracts
How does Contract.Ensures work?

I'm starting to use Code Contracts, and whilst Contract.Requires is pretty straight forward, I'm having trouble seeing what Ensures …

c# code-contracts
Generate Contracts for REST objects

I'm new to REST and this sounds like it should be pretty simple. In a .NET app, I can create …

c# rest windows-phone-7 code-contracts
C#: Code Contracts vs. normal parameter validation

consider the following two pieces of code: public static Time Parse(string value) { string regXExpres = "^([0-9]|[0-1][0-9]|2[0-3]):([0-9]|[0…

c# .net .net-4.0 code-contracts microsoft-contracts
Throwing an exception vs Contract.Requires<T>?

I'm wondering whether should I throw exceptions or call Contract.Requires<TException> For example: public static void Function(…

c# exception error-handling code-contracts
how to install and use Code Contracts?

I have a basic question, might be it is so obvious but for some reason i can't seem to be …

c# visual-studio-2010 code-contracts
Code Contracts doesn't seem to work on VS2012

I'm reading up on Code Contracts, which at first glance seem to be pretty revolutionary, but I can't seem to …

c# .net visual-studio-2012 code-contracts