Click to Rate and Give Feedback
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Team Test API
StringAssert Class

Verifies true/false propositions associated with strings in unit tests.

Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
Visual Basic (Declaration)
Public NotInheritable Class StringAssert
Visual Basic (Usage)
You do not need to declare an instance of a static class in order to access its members.
C#
public static class StringAssert
Visual C++
public ref class StringAssert abstract sealed
JScript
public final class StringAssert

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.

If the condition being verified is not true, the assertion fails.

ms245503.alert_caution(en-us,VS.90).gifImportant Note:

The StringAssert class throws an 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.

System..::.Object
  Microsoft.VisualStudio.TestTools.UnitTesting..::.StringAssert
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker