May 2010
Intermediate to advanced
1272 pages
61h 18m
English
The Contract class exposes a ContractFailed event that is raised when a condition is violated and that you can handle to get detailed information. The following sample event handler shows how to collect violation information:

The ContractFailedEventArgs.Condition property is a string storing the condition while the ContractFailedEventArgs.FailureKind is an enumeration offering the failure kind (for example, Precondition, Invariant, and so on).
This chapter illustrated the Visual Studio instrumentation and libraries about testing applications. The first discussion was about unit testing, a technique used for checking if ...
Read now
Unlock full access