It's experimental, but you could look into Spec#. It can provide you with more compile-time checks. Code Contracts are another option (but that's only available in certain editions of Visual Studio).
Edit:
Looks like code contacts may now be available as a standalone download! See this page!