Option to temporarily pause the run from the test code.
Bug #730891 reported by
Nicolas Rivera
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Triaged
|
Low
|
Unassigned |
Bug Description
[This issue is now tracked at https:/
This request is being changed after discussion on our mailing list. The new description is:
Add a method to Assert or TestContext to allow the user to cause the run to be paused while external action is taken. This is a general facility and will make it easier to do a number of things, including:
* Taking a dump
* Attaching a debugger
* Checking the status of external devices
Changed in nunit-3.0: | |
importance: | Undecided → Low |
status: | Confirmed → Triaged |
tags: | added: console |
tags: | removed: console |
description: | updated |
tags: | added: github |
To post a comment you must log in.
For anyone interested, I think I found a workaround. The following adding seems to do the trick:
[NUnitAddin( Description = "Stop Upon Failure")] AddIn : IAddin, EventListener
public class StopUponFailure
{
#region IAddin Members
public bool Install( IExtensionHost host) eption( "host") ;
{
if (host == null)
throw new ArgumentNullExc
if (listeners == null)
return false;
return true;
}
#endregion
#region EventListener Members
public void RunFinished( Exception exception)
{
}
public void RunFinished( TestResult result)
{
}
public void RunStarted(string name, int testCount)
{
}
public void SuiteFinished( TestResult result)
{
}
public void SuiteStarted( TestName testName)
{
}
public void TestFinished( TestResult result)
Trace. WriteLine( "STOPPING TEST EXECUTION");
Thread. Sleep(Timeout. Infinite) ;
{
if (result.IsError || result.IsFailure)
{
}
}
public void TestOutput( TestOutput testOutput)
{
}
public void TestStarted( TestName testName)
{
}
public void UnhandledExcept ion(Exception exception)
{
}
#endregion
}