Failing Debug Tests do not break into debugger in VS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Test Adapter |
Triaged
|
High
|
Unassigned |
Bug Description
When Debugging a failing synchronous unit test, Visual Studio will break into the debugger as the Exception is thrown (with break on exceptions set to User-Unhandled). However, with an async nunit test, it looks like the exception is being swallowed by the test runner and does not cause VS to break. Setting break on exceptions to "Thrown" WILL cause it to break.
Sample Code:
[TestFixture]
public class SampleFixture
{
[Test]
public async Task AsyncTest()
{
}
[Test]
public void SyncTest()
{
}
}
Instructions to reproduce:
* Start a new Class Library project in Visual Studio (tested under 2012 and 2013 Preview, tested with Framework 4.5 project).
* Add the above code as a class
* Build the project
* Ensure "Break on Exceptions" is set to "User-Unhandled" for "Common Language Runtime Exceptions"
* Right click "SyncTest" in Test Explorer, click "Debug Selected Tests". Visual studio will automatically break at the Assert.Fail line.
* Right click "AsyncTest" in Test Explorer, click "Debug Selected Tests". Visual Studio will go into debug mode, and finish immediately without breaking into the debugger. Test failure will still be recorded in the Test Explorer.
Changed in nunit-vs-adapter: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in nunit-vs-adapter: | |
status: | Won't Fix → Triaged |
tags: | added: github |
(Tested on Visual Studio 2012 and 2013 Preview, using latest Test Adapter from Gallery - 0.96.0.4, and using nunit from nuget)