Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2010
 UnitTestOutcome Enumeration
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

Other versions are also available for the following:
API Reference for Testing Tools for Visual Studio ALM
UnitTestOutcome Enumeration

Use UnitTestOutcome to programmatically determine the outcome of a test that has run or is currently running.

Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
Visual Basic
Public Enumeration UnitTestOutcome
C#
public enum UnitTestOutcome
Visual C++
public enum class UnitTestOutcome
F#
type UnitTestOutcome
JScript
public enum UnitTestOutcome
Member nameDescription
FailedThe test failed.
InconclusiveAn Assert.Inconclusive was raised.
PassedThe test passed.
InProgressThe test is currently running.
Error
Timeout
Aborted
UnknownThe outcome of the test is unknown.

The members of this class contain a subset of all the possible test outcomes. For more information, see Basic Test Results.

You can refer to this class, for example, from a test method or a test-cleanup method that follows a unit test.

The UnitTestOutcome is passed in the TestContext.

You could compare TestContext.Outcome with UnitTestOutcome.Failed to determine the result of a specific test, and then take appropriate action, such as deleting certain files from the hard disk.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker