Code Contracts

 pre-conditions, post-conditions, object invariants in .NET - go here