On method level you can check the prerequisites before the method is executed (requires) and the results after the method has executed (ensure).
On Class level, you can only check the results after a method has executed (invariants).
It would be nice to have the possibility to check the prerequisites on class level too (private / public requires).
Example usage scenarios:
- check if the object has been disposed before executing any method.
- check if the object is ready to respond to any action (b.e. state not correct because of still executing async code)