IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Framework.Interfaces.ResultState Class Reference

The ResultState class represents the outcome of running a test. It contains two pieces of information. The Status of the test is an enum indicating whether the test passed, failed, was skipped or was inconclusive. The Label provides a more detailed breakdown for use by client runners. More...

+ Collaboration diagram for NUnit.Framework.Interfaces.ResultState:

Public Member Functions

 ResultState (TestStatus status)
 Initializes a new instance of the ResultState class. More...
 
 ResultState (TestStatus status, string label)
 Initializes a new instance of the ResultState class. More...
 
 ResultState (TestStatus status, FailureSite site)
 Initializes a new instance of the ResultState class. More...
 
 ResultState (TestStatus status, string label, FailureSite site)
 Initializes a new instance of the ResultState class. More...
 
ResultState WithSite (FailureSite site)
 Get a new ResultState, which is the same as the current one but with the FailureSite set to the specified value. More...
 
override bool Equals (object obj)
 Determines whether the specified System.Object, is equal to this instance. More...
 
override int GetHashCode ()
 Returns a hash code for this instance. More...
 
override string ToString ()
 Returns a System.String that represents this instance. More...
 

Static Public Attributes

static readonly ResultState Inconclusive = new ResultState(TestStatus.Inconclusive)
 The result is inconclusive More...
 
static readonly ResultState Skipped = new ResultState(TestStatus.Skipped)
 The test has been skipped. More...
 
static readonly ResultState Ignored = new ResultState(TestStatus.Skipped, "Ignored")
 The test has been ignored. More...
 
static readonly ResultState Explicit = new ResultState(TestStatus.Skipped, "Explicit")
 The test was skipped because it is explicit More...
 
static readonly ResultState Success = new ResultState(TestStatus.Passed)
 The test succeeded More...
 
static readonly ResultState Failure = new ResultState(TestStatus.Failed)
 The test failed More...
 
static readonly ResultState Error = new ResultState(TestStatus.Failed, "Error")
 The test encountered an unexpected exception More...
 
static readonly ResultState Cancelled = new ResultState(TestStatus.Failed, "Cancelled")
 The test was cancelled by the user More...
 
static readonly ResultState NotRunnable = new ResultState(TestStatus.Failed, "Invalid")
 The test was not runnable. More...
 
static readonly ResultState ChildFailure = ResultState.Failure.WithSite(FailureSite.Child)
 A suite failed because one or more child tests failed or had errors More...
 
static readonly ResultState SetUpFailure = ResultState.Failure.WithSite(FailureSite.SetUp)
 A suite failed in its OneTimeSetUp More...
 
static readonly ResultState SetUpError = ResultState.Error.WithSite(FailureSite.SetUp)
 A suite had an unexpected exception in its OneTimeSetUp More...
 
static readonly ResultState TearDownError = ResultState.Error.WithSite(FailureSite.TearDown)
 A suite had an unexpected exception in its OneTimeDown More...
 

Properties

TestStatus Status [get, private set]
 Gets the TestStatus for the test. More...
 
string Label [get, private set]
 Gets the label under which this test result is categorized, if any. More...
 
FailureSite Site [get, private set]
 Gets the stage of test execution in which the failure or other result took place. More...
 

Detailed Description

The ResultState class represents the outcome of running a test. It contains two pieces of information. The Status of the test is an enum indicating whether the test passed, failed, was skipped or was inconclusive. The Label provides a more detailed breakdown for use by client runners.

Constructor & Destructor Documentation

NUnit.Framework.Interfaces.ResultState.ResultState ( TestStatus  status,
string  label 
)
inline

Initializes a new instance of the ResultState class.

Parameters
statusThe TestStatus.
labelThe label.
NUnit.Framework.Interfaces.ResultState.ResultState ( TestStatus  status,
FailureSite  site 
)
inline

Initializes a new instance of the ResultState class.

Parameters
statusThe TestStatus.
siteThe stage at which the result was produced
NUnit.Framework.Interfaces.ResultState.ResultState ( TestStatus  status,
string  label,
FailureSite  site 
)
inline

Initializes a new instance of the ResultState class.

Parameters
statusThe TestStatus.
labelThe label.
siteThe stage at which the result was produced

Member Function Documentation

override bool NUnit.Framework.Interfaces.ResultState.Equals ( object  obj)
inline

Determines whether the specified System.Object, is equal to this instance.

Parameters
objThe System.Object to compare with this instance.
Returns
true if the specified System.Object is equal to this instance; otherwise, false.

References NUnit.Framework.Interfaces.ResultState.Equals().

Referenced by NUnit.Framework.Interfaces.ResultState.Equals().

override int NUnit.Framework.Interfaces.ResultState.GetHashCode ( )
inline

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
override string NUnit.Framework.Interfaces.ResultState.ToString ( )
inline

Member Data Documentation

readonly ResultState NUnit.Framework.Interfaces.ResultState.Explicit = new ResultState(TestStatus.Skipped, "Explicit")
static
readonly ResultState NUnit.Framework.Interfaces.ResultState.Success = new ResultState(TestStatus.Passed)
static

The test succeeded

Referenced by NUnit.Framework.Internal.TestResult.AddResult(), NUnit.Framework.Api.TestAssemblyRunnerTests.CancelRun_WhenTestIsRunning_StopsTest(), NUnit.Framework.Attributes.TestFixtureSourceTests.CheckArgument(), NUnit.Framework.Attributes.RandomAttributeTests.CheckRandomResult(), NUnit.Framework.Attributes.Tests.CommandWrapperTests.CorrectExceptionThrown(), NUnit.Framework.Internal.Commands.TheoryResultCommand.Execute(), NUnit.Framework.Internal.Commands.MaxTimeCommand.Execute(), NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(), NUnit.Framework.RepeatAttribute.RepeatedTestCommand.Execute(), NUnit.Framework.Attributes.Tests.CommandWrapperTests.ExpectedExceptionAttribute.ExpectedExceptionCommand.Execute(), NUnit.TestUtilities.TestAssert.IsRunnable(), NUnit.Framework.Tests.TestContextOneTimeTearDownTests.OneTimeTearDown(), NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork(), NUnit.Framework.Attributes.OneTimeSetupTearDownTest.RerunFixtureAfterSetUpFixed(), NUnit.Framework.Attributes.DatapointTests.RunTestOnFixture(), NUnit.Framework.Internal.SuccessResultTests.SimulateTestRun(), NUnit.Framework.Internal.MixedResultTests.SimulateTestRun(), NUnit.Framework.Internal.MinimumDurationResultTests.SimulateTestRun(), NUnit.Framework.Api.TestAssemblyRunnerTests.StopRun_WhenTestIsRunning_StopsTest(), NUnit.Framework.Internal.ResultStateTests.Success_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.SuccessResultTests.SuiteResultIsSuccess(), NUnit.Framework.Tests.TestContextTearDownTests.TearDown(), NUnitLite.Tests.TeamCityEventListenerTests.TestFinished_Passed(), NUnit.Framework.Internal.TestMethodSignatureTests.TestMethodWithMultipleTestCasesExecutesMultipleTimes(), NUnit.Framework.Internal.SuccessResultTests.TestResultIsSuccess(), NUnit.Framework.Tests.ActionAttributeTests.TestsRunSuccessfully(), NUnit.Framework.Attributes.TimeoutTests.TestTimeOutNotElapsed(), and NUnit.Framework.Attributes.TimeoutTests.TestTimeOutTestCaseWithOutElapsed().

readonly ResultState NUnit.Framework.Interfaces.ResultState.Failure = new ResultState(TestStatus.Failed)
static

The test failed

Referenced by NUnit.Framework.Assertions.AssertFailTests.AssertFailWorks(), NUnit.Framework.Assertions.AssertFailTests.AssertFailWorksWithMessage(), NUnit.Framework.Assertions.AssertFailTests.AssertFailWorksWithMessageAndArgs(), NUnit.Framework.Internal.Commands.TheoryResultCommand.Execute(), NUnit.Framework.Internal.Commands.MaxTimeCommand.Execute(), NUnit.Framework.RetryAttribute.RetryCommand.Execute(), NUnit.Framework.Attributes.Tests.CommandWrapperTests.ExpectedExceptionAttribute.ExpectedExceptionCommand.Execute(), NUnit.Framework.Internal.ResultStateTests.Failure_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Attributes.MaxTimeTests.FailureReportHasPriorityOverMaxTime(), NUnit.Framework.Attributes.Tests.CommandWrapperTests.NoExceptionThrown(), NUnit.Framework.Internal.Execution.WorkItem.RunTestOnOwnThread(), NUnit.Framework.Attributes.TimeoutTests.SetUpTimesOutAndTearDownIsRun(), NUnit.Framework.Internal.FailedResultTests.SimulateTestRun(), NUnit.Framework.Internal.MixedResultTests.SimulateTestRun(), NUnitLite.Tests.TeamCityEventListenerTests.TestFinished_Failed(), NUnit.Framework.Internal.FailedResultTests.TestResultIsFailure(), NUnit.Framework.Attributes.TimeoutTests.TestTimeOutElapsed(), NUnit.Framework.Attributes.TimeoutTests.TestTimeOutTestCaseWithOutElapsed(), NUnit.Framework.Attributes.TimeoutTests.TestTimesOutAndTearDownIsRun(), NUnit.Framework.Attributes.TheoryTests.TheoryFailsIfAllTestsAreInconclusive(), NUnit.Framework.Attributes.TimeoutTests.TimeoutCanBeSetOnTestFixture(), and NUnit.Framework.Attributes.Tests.CommandWrapperTests.WrongExceptionThrown().

readonly ResultState NUnit.Framework.Interfaces.ResultState.NotRunnable = new ResultState(TestStatus.Failed, "Invalid")
static

The test was not runnable.

Referenced by NUnit.Framework.Internal.GenericTestMethodTests.Combinatorial_IncompatibleArgsAreNotRunnable(), NUnit.Framework.Internal.Commands.SkipCommand.Execute(), NUnit.Framework.Attributes.TestCaseSourceTests.HandlesExceptionInTestCaseSource(), NUnit.Framework.Internal.ResultStateTests.NotRunnable_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork(), NUnit.Framework.Api.TestAssemblyRunnerTests.Run_BadFile_ReturnsNonRunnableSuite(), NUnit.Framework.Api.TestAssemblyRunnerTests.Run_FileNotFound_ReturnsNonRunnableSuite(), NUnit.Framework.Api.TestAssemblyRunnerTests.RunAsync_BadFile_ReturnsNonRunnableSuite(), NUnit.Framework.Api.TestAssemblyRunnerTests.RunAsync_FileNotFound_ReturnsNonRunnableSuite(), NUnit.Framework.Internal.NotRunnableResultTests.SimulateTestRun(), NUnit.Framework.Attributes.TestCaseSourceTests.SourceUsingInstanceFieldIsNotRunnable(), NUnit.Framework.Attributes.TestCaseSourceTests.SourceUsingInstanceMethodIsNotRunnable(), NUnit.Framework.Attributes.TestCaseSourceTests.SourceUsingInstancePropertyIsNotRunnable(), NUnit.Framework.Internal.GenericTestMethodTests.TestCase_IncompatibleArgsAreNotRunnable(), NUnit.Framework.Internal.GenericTestMethodTests.TestCaseSource_IncompatibleArgsAreNotRunnable(), NUnit.Framework.Internal.NotRunnableResultTests.TestResultIsNotRunnable(), NUnit.Framework.Attributes.ValueSourceTests.ValueSourceMayNotBeInstanceField(), NUnit.Framework.Attributes.ValueSourceTests.ValueSourceMayNotBeInstanceMethod(), and NUnit.Framework.Attributes.ValueSourceTests.ValueSourceMayNotBeInstanceProperty().

readonly ResultState NUnit.Framework.Interfaces.ResultState.SetUpFailure = ResultState.Failure.WithSite(FailureSite.SetUp)
static

A suite failed in its OneTimeSetUp

readonly ResultState NUnit.Framework.Interfaces.ResultState.TearDownError = ResultState.Error.WithSite(FailureSite.TearDown)
static

Property Documentation

TestStatus NUnit.Framework.Interfaces.ResultState.Status
getprivate set

Gets the TestStatus for the test.

The status.

Referenced by NUnit.Framework.Internal.TestResult.AddResult(), NUnit.Framework.Internal.TestResult.AddToXml(), NUnit.Framework.Internal.SetUpFixtureTests.AssemblySetupFixtureWrapsExecutionOfTest(), NUnit.Framework.Internal.ResultStateTests.Cancelled_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.ChildFailure_ReturnsResultStateWithPropertiesSet(), NUnitLite.TextUI.DisplayErrorsAndFailures(), NUnitLite.TextUI.DisplaySummaryReport(), NUnitLite.TextUI.DisplayTestResult(), NUnit.Framework.Internal.ResultStateTests.Error_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Failure_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Ignored_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Inconclusive_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.SetUpFixtureTests.InvalidSetUpFixtureTest(), NUnitLite.NUnit3XmlOutputWriter.MakeTestRunElement(), NUnit.Framework.Internal.SetUpFixtureTests.NamespaceSetUpFixtureWrapsExecutionOfSingleTest(), NUnit.Framework.Internal.SetUpFixtureTests.NamespaceSetUpFixtureWrapsExecutionOfTwoTests(), NUnit.Framework.Internal.SetUpFixtureTests.NamespaceSetUpFixtureWrapsNestedNamespaceSetUpFixture(), NUnit.Framework.Internal.SetUpFixtureTests.NamespaceSetUpMethodsMayBeStatic(), NUnit.Framework.Internal.ResultStateTests.NotRunnable_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.Execution.CompositeWorkItem.OnChildCompleted(), NUnitLite.TextRunner.ReportResults(), NUnit.Framework.Internal.ResultStateTests.Skipped_ReturnsResultStateWithPropertiesCorrectlySet(), NUnitLite.NUnit2XmlOutputWriter.StartTestElement(), NUnit.Framework.Internal.ResultStateTests.Status_ConstructorWithOneArguments_ReturnsConstructorArgumentStatus(), NUnit.Framework.Internal.ResultStateTests.Status_ConstructorWithTwoArguments_ReturnsConstructorArgumentStatus(), NUnit.Framework.Internal.ResultStateTests.Success_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.TestUtilities.ResultSummary.Summarize(), NUnitLite.ResultSummary.Summarize(), NUnitLite.TeamCityEventListener.TestFinished(), NUnit.Framework.Api.TestAssemblyRunnerTests.TestFinished(), NUnitLite.NUnit2XmlOutputWriter.TranslateResult(), NUnit.Framework.Internal.SetUpFixtureTests.WithTwoSetUpFixturesBothAreUsed(), and NUnitLite.NUnit2XmlOutputWriter.WriteResultElement().

string NUnit.Framework.Interfaces.ResultState.Label
getprivate set

Gets the label under which this test result is categorized, if any.

Referenced by NUnit.Framework.Internal.TestResult.AddResult(), NUnit.Framework.Internal.TestResult.AddToXml(), NUnit.Framework.Internal.ResultStateTests.Cancelled_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.ChildFailure_ReturnsResultStateWithPropertiesSet(), NUnitLite.TextUI.DisplayTestResult(), NUnit.Framework.Internal.ResultStateTests.Error_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Failure_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Ignored_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Inconclusive_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Label_ConstructorWithOneArguments_ReturnsStringEmpty(), NUnit.Framework.Internal.ResultStateTests.Label_ConstructorWithTwoArguments_ReturnsConstructorArgumentLabel(), NUnit.Framework.Internal.ResultStateTests.Label_ConstructorWithTwoArgumentsLabelArgumentIsNull_ReturnsEmptyString(), NUnitLite.NUnit3XmlOutputWriter.MakeTestRunElement(), NUnit.Framework.Internal.ResultStateTests.NotRunnable_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Skipped_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Success_ReturnsResultStateWithPropertiesCorrectlySet(), NUnitLite.ResultSummary.Summarize(), and NUnitLite.NUnit2XmlOutputWriter.TranslateResult().

FailureSite NUnit.Framework.Interfaces.ResultState.Site
getprivate set

Gets the stage of test execution in which the failure or other result took place.

Referenced by NUnit.Framework.Internal.TestResult.AddToXml(), NUnit.Framework.Internal.ResultStateTests.Cancelled_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.ChildFailure_ReturnsResultStateWithPropertiesSet(), NUnitLite.TextUI.DisplayErrorsAndFailures(), NUnitLite.TextUI.DisplayTestResult(), NUnit.Framework.Internal.ResultStateTests.Error_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Failure_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Attributes.OneTimeSetupTearDownTest.HandleErrorInFixtureTearDownAfterErrorInTest(), NUnit.Framework.Internal.ResultStateTests.Ignored_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Inconclusive_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.NotRunnable_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Site_ConstructorWithOneArguments_ReturnsTest(), NUnit.Framework.Internal.ResultStateTests.Site_ConstructorWithThreeArguments_ReturnsSite(), NUnit.Framework.Internal.ResultStateTests.Site_ConstructorWithTwoArguments_ReturnsTest(), NUnit.Framework.Internal.ResultStateTests.Skipped_ReturnsResultStateWithPropertiesCorrectlySet(), NUnit.Framework.Internal.ResultStateTests.Success_ReturnsResultStateWithPropertiesCorrectlySet(), and NUnit.Framework.Attributes.TimeoutTests.TimeoutCanBeSetOnTestFixture().


The documentation for this class was generated from the following file: