Do invariant assertions fit into C# programming?
- by P.Brian.Mackey
In the book coders at work, the author asks "How do you use invariants in your code". Please explain what this question means.
I saw class invariants on wiki, but the example is in Java and I am not skilled enough in Java to relate this example to C#. .NET 4.0 introduces invariance, covariance, and contravariance and is well explained here. Invariance is so broad. The authors usage of the word seems unit test related. For those that read the book, what does the author mean? Are we talking about making an assumption and simply testing the validity after the unit test?