Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-469114: NUnit TestCase output not working (2018.1 EAP 6)

$
0
0
Reporter Janne Westberg (jannewestberg) Janne Westberg (jannewestberg)
Created Apr 5, 2018 4:43:59 PM
Updated Apr 17, 2018 11:06:02 AM
Subsystem Unit Testing
Assignee Eugene Strizhok (Eugene.Strizhok)
Priority Normal
State Submitted
Type Bug
Fix version No Fix versions
Affected versions 2018.1
Fixed In Version ReSharper Undefined
VsVersion All Versions

Hi, this bug was found in following versions:

ReSharper 2018.1 EAP 5.
ReSharper 2018.1 EAP 6.

When executing NUnit tests that have a TestCase attribute, the output does not work when using TestContext.Progress.
It works fine in tests that have a Test attribute.

Example below that reproduces the issue.
Output in test methods 1 and 2 work OK.
Output in test methods 3 and 4 does not work.

[Test]
public void TestMethod1_TestAttribute_UsingProgressInConsoleOut()
{
Console.SetOut(TestContext.Progress);
Console.WriteLine("Hello world"); // Output works OK.
}

[Test]
public void TestMethod2_TestAttribute_UsingProgressWriteLine()
{
TestContext.Progress.WriteLine("Hello world"); // Output works OK.
}

[TestCase]
public void TestMethod3_TestCaseAttribute_UsingProgressInConsoleOut()
{
Console.SetOut(TestContext.Progress);
Console.WriteLine("Hello world"); // Output does not work - nothing is shown.
}

[TestCase]
public void TestMethod4_TestCaseAttribute_UsingProgressWriteLine()
{
TestContext.Progress.WriteLine("Hello world"); // Output does not work - nothing is shown.
}


Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>