Skip to content

Commit

Permalink
[TouchRunner] Improve name printing in NuGet mode. (#68)
Browse files Browse the repository at this point in the history
* The full name is printed for the test suite
* The simple name is printed for each test fixture.
  • Loading branch information
rolfbjarne committed Jul 14, 2020
1 parent 8f2d02e commit 09733ed
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions NUnitLite/TouchRunner/TouchRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,11 @@ public void TestStarted (ITest test)
{
if (test is TestSuite) {
Writer.WriteLine ();
#if NUNITLITE_NUGET
Writer.WriteLine (test.FullName);
#else
Writer.WriteLine (test.Name);
#endif
}
}

Expand All @@ -407,7 +411,11 @@ public virtual void TestFinished (ITestResult r)
if (!result.IsFailure () && !result.IsSuccess () && !result.IsInconclusive () && !result.IsIgnored ())
Writer.WriteLine ("\t[INFO] {0}", result.Message);

#if NUNITLITE_NUGET
string name = result.Test.FullName;
#else
string name = result.Test.Name;
#endif
if (!String.IsNullOrEmpty (name))
Writer.WriteLine ("{0} : {1} ms", name, result.GetDuration ().TotalMilliseconds);
} else {
Expand All @@ -427,12 +435,12 @@ public virtual void TestFinished (ITestResult r)
Writer.Write ("\t[INFO] ");
}
#if NUNITLITE_NUGET
Writer.Write (result.Test.FullName);
Writer.Write (result.Test.Name);
#else
Writer.Write (result.Test.FixtureType.Name);
#endif
Writer.Write (".");
Writer.Write (result.Test.Name);
#endif

string message = result.Message;
if (!String.IsNullOrEmpty (message)) {
Expand Down

0 comments on commit 09733ed

Please sign in to comment.