Skip to content

Commit dbf62c0

Browse files
committed
Changes from code review
1 parent 86b835d commit dbf62c0

36 files changed

+39
-178
lines changed

src/NUnitCommon/nunit.agent.core.tests/Drivers/NotRunnableFrameworkDriverTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using NUnit.Framework;
77
using NUnit.Framework.Internal;
88
using NUnit.Engine.Extensibility;
9-
using NUnit.Engine.Internal;
109
using System;
1110

1211
namespace NUnit.Engine.Drivers

src/NUnitCommon/nunit.agent.core.tests/Runners/TestAgentRunnerTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.IO;
66
using System.Linq;
77
using System.Xml;
8-
using NUnit.Engine.Internal;
98
using NUnit.Framework;
109
using NUnit.TestData;
1110
using NUnit.TestData.Assemblies;

src/NUnitCommon/nunit.agent.core/AgentDirectRunner.cs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.IO;
55
using System.Xml;
66
using NUnit.TextDisplay;
7+
using NUnit.Common;
78
using NUnit.Engine;
89
using NUnit.Engine.Runners;
910

src/NUnitCommon/nunit.agent.core/Drivers/DriverService.cs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Generic;
55
using System.IO;
66
using System.Reflection;
7+
using NUnit.Common;
78
using NUnit.Engine.Extensibility;
89
using TestCentric.Metadata;
910

src/NUnitCommon/nunit.agent.core/NUnitAgent.cs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IO;
66
using System.Security;
77
using System.Reflection;
8+
using NUnit.Common;
89
using NUnit.Engine.Agents;
910

1011
#if NETFRAMEWORK

src/NUnitCommon/nunit.agent.core/Runners/DomainManager.cs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using System.Security.Policy;
1212
using System.Security.Principal;
1313
using System.Linq;
14+
using NUnit.Common;
1415

1516
namespace NUnit.Engine.Runners
1617
{

src/NUnitCommon/nunit.common.tests/TcpChannelUtilsTests.cs renamed to src/NUnitCommon/nunit.common.tests/Communication/Transports/Remoting/TcpChannelUtilsTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using NUnit.Framework;
99
using NUnit.Framework.Constraints;
1010

11-
namespace NUnit.Engine.Internal
11+
namespace NUnit.Engine.Communication.Transports.Remoting
1212
{
1313
[TestFixture]
1414
[Parallelizable(ParallelScope.None)] // GetTcpChannel affects the whole AppDomain

src/NUnitCommon/nunit.common.tests/PathUtilTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Runtime.InteropServices;
66
using NUnit.Framework;
77

8-
namespace NUnit.Engine.Internal
8+
namespace NUnit.Common
99
{
1010
[TestFixture]
1111
public class PathUtilsTests

src/NUnitCommon/nunit.common.tests/TextDisplay/ResultReporterTests.cs

+6-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IO;
66
using System.Text;
77
using System.Xml;
8+
using NUnit.Common;
89
using NUnit.Engine;
910
using NUnit.Framework;
1011
using NUnit.Framework.Api;
@@ -19,13 +20,11 @@ public class ResultReporterTests
1920
private StringBuilder _reportBuilder;
2021
private ExtendedTextWrapper _writer;
2122

22-
private string ReportOutput => _reportBuilder.ToString();
23-
2423
private List<string> ReportLines
2524
{
2625
get
2726
{
28-
var rdr = new StringReader(ReportOutput);
27+
var rdr = new StringReader(_reportBuilder.ToString());
2928

3029
string? line;
3130
var lines = new List<string>();
@@ -86,9 +85,10 @@ public void ReportSequenceTest()
8685

8786
int last = -1;
8887

88+
string reportOutput = _reportBuilder.ToString();
8989
foreach (string title in reportSequence)
9090
{
91-
var index = ReportOutput.IndexOf(title);
91+
var index = reportOutput.IndexOf(title);
9292
Assert.That(index > 0, "Report not found: " + title);
9393
Assert.That(index > last, "Report out of sequence: " + title);
9494
last = index;
@@ -141,8 +141,9 @@ public void ErrorsFailuresAndWarningsReportTest()
141141

142142
ResultReporter.WriteErrorsFailuresAndWarningsReport(_result, _writer);
143143

144+
string reportOutput = _reportBuilder.ToString();
144145
foreach (var item in expected)
145-
Assert.That(ReportOutput.Contains(item));
146+
Assert.That(reportOutput.Contains(item));
146147
}
147148

148149
[Test]
@@ -178,12 +179,6 @@ public void TestsNotRunTest()
178179
Assert.That(ReportLines, Is.EqualTo(expected));
179180
}
180181

181-
//[Test, Explicit("Displays failure behavior")]
182-
//public void WarningsOnlyDisplayOnce()
183-
//{
184-
// Assert.Warn("Just a warning");
185-
//}
186-
187182
[Test]
188183
public void TestParameterSettingsWrittenCorrectly()
189184
{

src/NUnitCommon/nunit.common/AgentExitCodes.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt
22

3-
namespace NUnit
3+
namespace NUnit.Common
44
{
55
public static class AgentExitCodes
66
{

src/NUnitCommon/nunit.common/TcpChannelUtils.ObservableServerChannelSinkProvider.cs renamed to src/NUnitCommon/nunit.common/Communitcation/Transports/Remoting/TcpChannelUtils.ObservableServerChannelSinkProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Runtime.Remoting.Channels;
88
using System.Runtime.Remoting.Messaging;
99

10-
namespace NUnit.Engine
10+
namespace NUnit.Engine.Communication.Transports.Remoting
1111
{
1212
partial class TcpChannelUtils
1313
{

src/NUnitCommon/nunit.common/TcpChannelUtils.cs renamed to src/NUnitCommon/nunit.common/Communitcation/Transports/Remoting/TcpChannelUtils.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
#if NETFRAMEWORK
44
using System;
55
using System.Collections.Generic;
6-
using System.Runtime.Remoting;
76
using System.Runtime.Remoting.Channels;
87
using System.Runtime.Remoting.Channels.Tcp;
98
using System.Runtime.Serialization.Formatters;
109
using System.Threading;
1110

12-
namespace NUnit.Engine
11+
namespace NUnit.Engine.Communication.Transports.Remoting
1312
{
1413
/// <summary>
1514
/// A collection of utility methods used to create, retrieve

src/NUnitCommon/nunit.common/DotNet.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.IO;
66
using System.Runtime.InteropServices;
77

8-
namespace NUnit.Engine
8+
namespace NUnit.Common
99
{
1010
public static class DotNet
1111
{

src/NUnitCommon/nunit.common/FrameworkIdentifers.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt
22

3-
namespace NUnit
3+
namespace NUnit.Common
44
{
55
public static class FrameworkIdentifiers
66
{

src/NUnitCommon/nunit.common/Modernization/StringExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#if !NETSTANDARD2_1 && !NETCOREAPP2_0_OR_GREATER
44

5-
namespace NUnit.Common
5+
namespace NUnit
66
{
77
public static class StringExtensions
88
{

src/NUnitCommon/nunit.common/PathUtils.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Collections.Generic;
88
using System.Runtime.InteropServices;
99

10-
namespace NUnit
10+
namespace NUnit.Common
1111
{
1212
/// <summary>
1313
/// Static methods for manipulating project paths, including both directories

src/NUnitCommon/nunit.common/ResultSummary.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System;
44
using System.Xml;
55

6-
namespace NUnit
6+
namespace NUnit.Common
77
{
88
/// <summary>
99
/// Summary description for ResultSummary.

src/NUnitCommon/nunit.common/RuntimeInformation.cs

-110
This file was deleted.

src/NUnitCommon/nunit.common/TestPackageExtensions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
using System;
44
using System.Collections.Generic;
5+
using NUnit.Common;
56

67
namespace NUnit.Engine
78
{

src/NUnitCommon/nunit.common/ClientTestResult.cs renamed to src/NUnitCommon/nunit.common/TextDisplay/ClientTestResult.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt
22

3-
using System;
43
using System.Collections.Generic;
5-
using System.Text;
64
using System.Xml;
7-
using NUnit.TextDisplay;
85

9-
namespace NUnit
6+
namespace NUnit.TextDisplay
107
{
118
/// <summary>
129
/// ConsoleTestResult represents the result of one test being
@@ -73,7 +70,7 @@ public List<AssertionResult> Assertions
7370
XmlNodeList? assertions = _resultNode.SelectNodes("assertions/assertion");
7471
if (assertions is not null)
7572
foreach (XmlNode assertion in assertions)
76-
Assertions.Add(new ClientTestResult.AssertionResult(assertion));
73+
Assertions.Add(new AssertionResult(assertion));
7774
}
7875

7976
return _assertions;

src/NUnitCommon/nunit.common/TextDisplay/ResultReporter.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Globalization;
66
using System.Reflection;
77
using System.Xml;
8+
using NUnit.Common;
89

910
namespace NUnit.TextDisplay
1011
{
@@ -17,8 +18,6 @@ public static void WriteHeader(ExtendedTextWriter writer)
1718

1819
var header = $"{versionBlock.ProductName} {versionBlock.ProductVersion}";
1920

20-
var configurationAttributes = entryAssembly.GetCustomAttribute<AssemblyConfigurationAttribute>();
21-
2221
writer.WriteLine(ColorStyle.Header, header);
2322
writer.WriteLine(ColorStyle.SubHeader, versionBlock.LegalCopyright ?? "No Copyright statement found");
2423
writer.WriteLine(ColorStyle.SubHeader, DateTime.Now.ToString(CultureInfo.CurrentCulture.DateTimeFormat.FullDateTimePattern));

src/NUnitCommon/nunit.extensibility.tests/ExtensionSelectorTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System;
55
using System.Runtime.Versioning;
66
using NSubstitute;
7-
using NUnit.Extensibility;
7+
using NUnit.Common;
88
using NUnit.Framework;
99

1010
namespace NUnit.Extensibility

src/NUnitCommon/nunit.extensibility/AddinsFileEntry.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Diagnostics.CodeAnalysis;
55
using System.IO;
6+
using NUnit.Common;
67

78
namespace NUnit.Extensibility
89
{

src/NUnitConsole/nunit4-console/ConsoleOptions.cs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.IO;
77
using System.Text;
88
using System.Text.RegularExpressions;
9-
using NUnit.Common;
109
using NUnit.ConsoleRunner.Options;
1110

1211
namespace NUnit.ConsoleRunner

src/NUnitConsole/nunit4-console/ConsoleRunner.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
using System.Collections.Generic;
55
using System.IO;
66
using System.Xml;
7+
using NUnit.Common;
78
using NUnit.ConsoleRunner.Utilities;
89
using NUnit.ConsoleRunner.Options;
910
using NUnit.Engine;
1011
using NUnit.Engine.Extensibility;
11-
using NUnit.Extensibility;
1212
using NUnit.TextDisplay;
1313
using System.Runtime.InteropServices;
1414
using System.Text;

0 commit comments

Comments
 (0)