Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Team Test API
Assert Class

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

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

Verifies conditions in unit tests using true/false propositions.

Namespace: Microsoft.VisualStudio.TestTools.UnitTesting
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in microsoft.visualstudio.qualitytools.unittestframework.dll)

Visual Basic (Declaration)
Public NotInheritable Class Assert
Visual Basic (Usage)
The members of a static class are accessed directly without an instance of the class.
C#
public static class Assert
C++
public ref class Assert abstract sealed
J#
public final class Assert
JScript
public final class Assert

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.

NoteImportant

The Assert 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.Assert
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Community Content   What is Community Content?
Add new content RSS  Annotations
Can't find Assert()      Tundra ... Noelle Mallory - MSFT   |   Edit   |   Show History
The referenced dll microsoft.visualstudio.qualitytools.unittestframework.dll is not on my machine. Assert has been around a long time yet it isn't available to me at this time. Whats up? Where can I get this dll or what ever I would need to access this function?
Tags What's this?: sample (x) vs (x) Add a tag
Flag as ContentBug
Same Problem...      dufagundes   |   Edit   |   Show History
I'm facing the same problem, thats why im going to use Mocks or Stubs to do my tests...

this #$%2 is breaking my legs...


Flag as ContentBug
It's installed in C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies      Markus The   |   Edit   |   Show History
by default with VS 2008...
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker