This documentation is archived and is not being maintained.
Assert Class
Visual Studio 2008
Verifies conditions in unit tests using true/false propositions.
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
This class contains a set of static methods that evaluate a Boolean condition. If this condition evaluates to true, the assertion passes.
An assertion verifies an assumption of truth for compared conditions. The assertion is central to the unit test. The Assert class provides many static methods for verifying suppositions of truth. If the condition being verified is not true, the assertion fails.
Important Note: |
|---|
The Assert class throws a AssertFailedException to signal a failure. This exception should not be captured. This exception is handled by the unit test engine to indicate an assert failure. |
Show:
Important Note: