From ad9b87ecce4dfc2ad020a14d48bdc8d53a6717d1 Mon Sep 17 00:00:00 2001 From: Charlie Poole Date: Fri, 3 Jan 2025 15:35:43 -0800 Subject: [PATCH] Eliminate NUnitNetStandardDriver; clean up unused conditionals --- .../Extensibility/IDriverFactory.cs | 8 +- .../Drivers/NUnitNetStandardDriverTests.cs | 125 ------------ .../Services/DriverServiceTests.cs | 8 +- .../Drivers/NUnit3DriverFactory.cs | 5 - .../Drivers/NUnitNetStandardDriver.cs | 187 ------------------ .../Internal/DomainDetailsBuilder.cs | 2 - .../nunit.engine.core/Internal/PathUtils.cs | 2 +- .../Runners/MasterTestRunnerTests.cs | 2 +- .../Services/TestFilteringTests.cs | 4 - .../Remoting/TestAgentRemotingProxy.cs | 2 - .../nunit.engine/Services/AgentStatus.cs | 2 - .../Services/AgentStore.AgentRecord.cs | 2 - .../nunit.engine/Services/AgentStore.cs | 2 - .../nunit.engine/Services/ExtensionService.cs | 10 - 14 files changed, 7 insertions(+), 354 deletions(-) delete mode 100644 src/NUnitEngine/nunit.engine.core.tests/Drivers/NUnitNetStandardDriverTests.cs delete mode 100644 src/NUnitEngine/nunit.engine.core/Drivers/NUnitNetStandardDriver.cs diff --git a/src/NUnitEngine/nunit.engine.api/Extensibility/IDriverFactory.cs b/src/NUnitEngine/nunit.engine.api/Extensibility/IDriverFactory.cs index c8eb3c7e3..fda047506 100644 --- a/src/NUnitEngine/nunit.engine.api/Extensibility/IDriverFactory.cs +++ b/src/NUnitEngine/nunit.engine.api/Extensibility/IDriverFactory.cs @@ -19,23 +19,23 @@ public interface IDriverFactory /// An AssemblyName referring to the possible test framework. bool IsSupportedTestFramework(AssemblyName reference); -#if NETSTANDARD || NETCOREAPP +#if NETFRAMEWORK /// /// Gets a driver for a given test assembly and a framework /// which the assembly is already known to reference. /// + /// The domain in which the assembly will be loaded /// An AssemblyName referring to the test framework. /// - IFrameworkDriver GetDriver(AssemblyName reference); + IFrameworkDriver GetDriver(AppDomain domain, AssemblyName reference); #else /// /// Gets a driver for a given test assembly and a framework /// which the assembly is already known to reference. /// - /// The domain in which the assembly will be loaded /// An AssemblyName referring to the test framework. /// - IFrameworkDriver GetDriver(AppDomain domain, AssemblyName reference); + IFrameworkDriver GetDriver(AssemblyName reference); #endif } } diff --git a/src/NUnitEngine/nunit.engine.core.tests/Drivers/NUnitNetStandardDriverTests.cs b/src/NUnitEngine/nunit.engine.core.tests/Drivers/NUnitNetStandardDriverTests.cs deleted file mode 100644 index a41af10b3..000000000 --- a/src/NUnitEngine/nunit.engine.core.tests/Drivers/NUnitNetStandardDriverTests.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt - -#if NETCOREAPP2_1 - -using System; -using System.Collections.Generic; -using System.Xml; -using NUnit.TestData.Assemblies; -using NUnit.Framework; -using NUnit.Engine.Extensibility; -using NUnit.Engine.Internal; - -namespace NUnit.Engine.Drivers.Tests -{ - [TestOf(typeof(NUnitNetStandardDriver))] - public class NUnitNetStandardDriverTests - { - private const string MOCK_ASSEMBLY = "mock-assembly.dll"; - private const string MISSING_FILE = "junk.dll"; - private const string NUNIT_FRAMEWORK = "nunit.framework"; - private const string LOAD_MESSAGE = "Method called without calling Load first"; - - private IDictionary _settings = new Dictionary(); - - private IFrameworkDriver _driver; - private string _mockAssemblyPath; - - [SetUp] - public void CreateDriver() - { - _mockAssemblyPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY); - _driver = new NUnitNetStandardDriver(); - - } - - [Test] - public void Load_GoodFile_ReturnsRunnableSuite() - { - var result = XmlHelper.CreateXmlNode(_driver.Load(_mockAssemblyPath, _settings)); - - Assert.That(result.Name, Is.EqualTo("test-suite")); - Assert.That(result.GetAttribute("type"), Is.EqualTo("Assembly")); - Assert.That(result.GetAttribute("runstate"), Is.EqualTo("Runnable")); - Assert.That(result.GetAttribute("testcasecount"), Is.EqualTo(MockAssembly.Tests.ToString())); - Assert.That(result.SelectNodes("test-suite").Count, Is.EqualTo(0), "Load result should not have child tests"); - } - - [Test] - public void Explore_AfterLoad_ReturnsRunnableSuite() - { - _driver.Load(_mockAssemblyPath, _settings); - var result = XmlHelper.CreateXmlNode(_driver.Explore(TestFilter.Empty.Text)); - - Assert.That(result.Name, Is.EqualTo("test-suite")); - Assert.That(result.GetAttribute("type"), Is.EqualTo("Assembly")); - Assert.That(result.GetAttribute("runstate"), Is.EqualTo("Runnable")); - Assert.That(result.GetAttribute("testcasecount"), Is.EqualTo(MockAssembly.Tests.ToString())); - Assert.That(result.SelectNodes("test-suite").Count, Is.GreaterThan(0), "Explore result should have child tests"); - } - - [Test] - public void ExploreTestsAction_WithoutLoad_ThrowsInvalidOperationException() - { - var ex = Assert.Catch(() => _driver.Explore(TestFilter.Empty.Text)); - if (ex is System.Reflection.TargetInvocationException) - ex = ex.InnerException; - Assert.That(ex, Is.TypeOf()); - Assert.That(ex.Message, Is.EqualTo(LOAD_MESSAGE)); - } - - [Test] - public void CountTestsAction_AfterLoad_ReturnsCorrectCount() - { - _driver.Load(_mockAssemblyPath, _settings); - Assert.That(_driver.CountTestCases(TestFilter.Empty.Text), Is.EqualTo(MockAssembly.Tests)); - } - - [Test] - public void CountTestsAction_WithoutLoad_ThrowsInvalidOperationException() - { - var ex = Assert.Catch(() => _driver.CountTestCases(TestFilter.Empty.Text)); - if (ex is System.Reflection.TargetInvocationException) - ex = ex.InnerException; - Assert.That(ex, Is.TypeOf()); - Assert.That(ex.Message, Is.EqualTo(LOAD_MESSAGE)); - } - - [Test] - public void RunTestsAction_AfterLoad_ReturnsRunnableSuite() - { - _driver.Load(_mockAssemblyPath, _settings); - var result = XmlHelper.CreateXmlNode(_driver.Run(new NullListener(), TestFilter.Empty.Text)); - - Assert.That(result.Name, Is.EqualTo("test-suite")); - Assert.That(result.GetAttribute("type"), Is.EqualTo("Assembly")); - Assert.That(result.GetAttribute("runstate"), Is.EqualTo("Runnable")); - Assert.That(result.GetAttribute("testcasecount"), Is.EqualTo(MockAssembly.Tests.ToString())); - Assert.That(result.GetAttribute("result"), Is.EqualTo("Failed")); - Assert.That(result.GetAttribute("passed"), Is.EqualTo(MockAssembly.PassedInAttribute.ToString())); - Assert.That(result.GetAttribute("failed"), Is.EqualTo(MockAssembly.Failed.ToString())); - Assert.That(result.GetAttribute("skipped"), Is.EqualTo(MockAssembly.Skipped.ToString())); - Assert.That(result.GetAttribute("inconclusive"), Is.EqualTo(MockAssembly.Inconclusive.ToString())); - Assert.That(result.SelectNodes("test-suite").Count, Is.GreaterThan(0), "Explore result should have child tests"); - } - - [Test] - public void RunTestsAction_WithoutLoad_ThrowsInvalidOperationException() - { - var ex = Assert.Catch(() => _driver.Run(new NullListener(), TestFilter.Empty.Text)); - if (ex is System.Reflection.TargetInvocationException) - ex = ex.InnerException; - Assert.That(ex, Is.TypeOf()); - Assert.That(ex.Message, Is.EqualTo(LOAD_MESSAGE)); - } - - public class NullListener : ITestEventListener - { - public void OnTestEvent(string testEvent) - { - // No action - } - } - } -} -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core.tests/Services/DriverServiceTests.cs b/src/NUnitEngine/nunit.engine.core.tests/Services/DriverServiceTests.cs index 61122628c..602c06242 100644 --- a/src/NUnitEngine/nunit.engine.core.tests/Services/DriverServiceTests.cs +++ b/src/NUnitEngine/nunit.engine.core.tests/Services/DriverServiceTests.cs @@ -38,16 +38,10 @@ public void CorrectDriverIsUsed(string fileName, bool skipNonTestAssemblies, Typ new TestCaseData("mock-assembly.dll", false, typeof(NUnitNetCore31Driver)), new TestCaseData("mock-assembly.dll", true, typeof(NUnitNetCore31Driver)), //new TestCaseData("notest-assembly.dll", false, typeof(NUnitNetCore31Driver)), -#elif NETCOREAPP3_1 +#else new TestCaseData("mock-assembly.dll", false, typeof(NUnitNetCore31Driver)), new TestCaseData("mock-assembly.dll", true, typeof(NUnitNetCore31Driver)), //new TestCaseData("notest-assembly.dll", false, typeof(NUnitNetCore31Driver)), -// TODO: This is never used. We need to test net standard driver in some way, possibly -// by forcing it's use in a separate test. -#elif NETCOREAPP2_1 - new TestCaseData("mock-assembly.dll", false, typeof(NUnitNetStandardDriver)), - new TestCaseData("mock-assembly.dll", true, typeof(NUnitNetStandardDriver)), - new TestCaseData("notest-assembly.dll", false, typeof(NUnitNetStandardDriver)), #endif // Invalid cases should work with all target runtimes new TestCaseData("mock-assembly.pdb", false, typeof(InvalidAssemblyFrameworkDriver)), diff --git a/src/NUnitEngine/nunit.engine.core/Drivers/NUnit3DriverFactory.cs b/src/NUnitEngine/nunit.engine.core/Drivers/NUnit3DriverFactory.cs index 5186570b0..78bf43c6f 100644 --- a/src/NUnitEngine/nunit.engine.core/Drivers/NUnit3DriverFactory.cs +++ b/src/NUnitEngine/nunit.engine.core/Drivers/NUnit3DriverFactory.cs @@ -47,13 +47,8 @@ public IFrameworkDriver GetDriver(AppDomain domain, AssemblyName reference) public IFrameworkDriver GetDriver(AssemblyName reference) { Guard.ArgumentValid(IsSupportedTestFramework(reference), "Invalid framework", "reference"); -#if NETSTANDARD - log.Info("Using NUnitNetStandardDriver"); - return new NUnitNetStandardDriver(); -#else log.Info("Using NUnitNetCore31Driver"); return new NUnitNetCore31Driver(); -#endif } #endif } diff --git a/src/NUnitEngine/nunit.engine.core/Drivers/NUnitNetStandardDriver.cs b/src/NUnitEngine/nunit.engine.core/Drivers/NUnitNetStandardDriver.cs deleted file mode 100644 index 275ac2aef..000000000 --- a/src/NUnitEngine/nunit.engine.core/Drivers/NUnitNetStandardDriver.cs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt - -#if NETSTANDARD -using System; -using System.Linq; -using System.Collections.Generic; -using NUnit.Engine.Internal; -using System.Reflection; -using NUnit.Engine.Extensibility; -using Mono.Cecil; - -namespace NUnit.Engine.Drivers -{ - /// - /// NUnitNetStandardDriver is used by the test-runner to load and run - /// tests using the NUnit framework assembly. - /// - /// NUnitNetStandardDriver was the original driver for the .NET Standard builds - /// of the engine, however has an issue with loading .NET Core assemblies - /// (https://github.com/nunit/nunit-console/issues/710) - /// is the replacement driver for running .NET Core tests, - /// and should be preferred for use with .NET Core 3.1 and later. - /// - public class NUnitNetStandardDriver : IFrameworkDriver - { - const string LOAD_MESSAGE = "Method called without calling Load first"; - const string INVALID_FRAMEWORK_MESSAGE = "Running tests against this version of the framework using this driver is not supported. Please update NUnit.Framework to the latest version."; - const string FAILED_TO_LOAD_TEST_ASSEMBLY = "Failed to load the test assembly {0}"; - const string FAILED_TO_LOAD_NUNIT = "Failed to load the NUnit Framework in the test assembly"; - - static readonly string CONTROLLER_TYPE = "NUnit.Framework.Api.FrameworkController"; - static readonly string LOAD_METHOD = "LoadTests"; - static readonly string EXPLORE_METHOD = "ExploreTests"; - static readonly string COUNT_METHOD = "CountTests"; - static readonly string RUN_METHOD = "RunTests"; - static readonly string RUN_ASYNC_METHOD = "RunTests"; - static readonly string STOP_RUN_METHOD = "StopRun"; - - static ILogger log = InternalTrace.GetLogger(nameof(NUnitNetStandardDriver)); - - Assembly _testAssembly; - Assembly _frameworkAssembly; - object _frameworkController; - Type _frameworkControllerType; - - /// - /// An id prefix that will be passed to the test framework and used as part of the - /// test ids created. - /// - public string ID { get; set; } - - /// - /// Loads the tests in an assembly. - /// - /// The NUnit Framework that the tests reference - /// The test assembly - /// The test settings - /// An Xml string representing the loaded test - public string Load(string testAssembly, IDictionary settings) - { - var idPrefix = string.IsNullOrEmpty(ID) ? "" : ID + "-"; - - using (var assemblyRef = AssemblyDefinition.ReadAssembly(testAssembly)) { - _testAssembly = Assembly.Load(new AssemblyName(assemblyRef.FullName)); - if(_testAssembly == null) - throw new NUnitEngineException(string.Format(FAILED_TO_LOAD_TEST_ASSEMBLY, assemblyRef.FullName)); - - var nunitRef = assemblyRef.MainModule.AssemblyReferences.Where(reference => reference.Name.Equals("nunit.framework", StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); - if (nunitRef == null) - throw new NUnitEngineException(FAILED_TO_LOAD_NUNIT); - - var nunit = Assembly.Load(new AssemblyName(nunitRef.FullName)); - if (nunit == null) - throw new NUnitEngineException(FAILED_TO_LOAD_NUNIT); - - _frameworkAssembly = nunit; - - _frameworkController = CreateObject(CONTROLLER_TYPE, _testAssembly, idPrefix, settings); - if (_frameworkController == null) - throw new NUnitEngineException(INVALID_FRAMEWORK_MESSAGE); - - _frameworkControllerType = _frameworkController.GetType(); - - log.Info("Loading {0} - see separate log file", _testAssembly.FullName); - return ExecuteMethod(LOAD_METHOD) as string; - } - } - - /// - /// Counts the number of test cases for the loaded test assembly - /// - /// The XML test filter - /// The number of test cases - public int CountTestCases(string filter) - { - CheckLoadWasCalled(); - object count = ExecuteMethod(COUNT_METHOD, filter); - return count != null ? (int)count : 0; - } - - /// - /// Executes the tests in an assembly. - /// - /// An ITestEventHandler that receives progress notices - /// A filter that controls which tests are executed - /// An Xml string representing the result - public string Run(ITestEventListener listener, string filter) - { - CheckLoadWasCalled(); - log.Info("Running {0} - see separate log file", _testAssembly.FullName); - Action callback = listener != null ? listener.OnTestEvent : (Action)null; - return ExecuteMethod(RUN_METHOD, new[] { typeof(Action), typeof(string) }, callback, filter) as string; - } - - /// - /// Executes the tests in an assembly asyncronously. - /// - /// A callback that receives XML progress notices - /// A filter that controls which tests are executed - public void RunAsync(Action callback, string filter) - { - CheckLoadWasCalled(); - log.Info("Running {0} - see separate log file", _testAssembly.FullName); - ExecuteMethod(RUN_ASYNC_METHOD, new[] { typeof(Action), typeof(string) }, callback, filter); - } - - /// - /// Cancel the ongoing test run. If no test is running, the call is ignored. - /// - /// If true, cancel any ongoing test threads, otherwise wait for them to complete. - public void StopRun(bool force) - { - ExecuteMethod(STOP_RUN_METHOD, force); - } - - /// - /// Returns information about the tests in an assembly. - /// - /// A filter indicating which tests to include - /// An Xml string representing the tests - public string Explore(string filter) - { - CheckLoadWasCalled(); - - log.Info("Exploring {0} - see separate log file", _testAssembly.FullName); - return ExecuteMethod(EXPLORE_METHOD, filter) as string; - } - - void CheckLoadWasCalled() - { - if (_frameworkController == null) - throw new InvalidOperationException(LOAD_MESSAGE); - } - - object CreateObject(string typeName, params object[] args) - { - var typeinfo = _frameworkAssembly.DefinedTypes.FirstOrDefault(t => t.FullName == typeName); - if (typeinfo == null) - { - log.Error("Could not find type {0}", typeName); - } - return Activator.CreateInstance(typeinfo.AsType(), args); - } - - object ExecuteMethod(string methodName, params object[] args) - { - var method = _frameworkControllerType.GetMethod(methodName, BindingFlags.Public | BindingFlags.Instance); - return ExecuteMethod(method, args); - } - - object ExecuteMethod(string methodName, Type[] ptypes, params object[] args) - { - var method = _frameworkControllerType.GetMethod(methodName, ptypes); - return ExecuteMethod(method, args); - } - - object ExecuteMethod(MethodInfo method, params object[] args) - { - if (method == null) - { - throw new NUnitEngineException(INVALID_FRAMEWORK_MESSAGE); - } - return method.Invoke(_frameworkController, args); - } - } -} -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/Internal/DomainDetailsBuilder.cs b/src/NUnitEngine/nunit.engine.core/Internal/DomainDetailsBuilder.cs index a3e3d6691..89827df5f 100644 --- a/src/NUnitEngine/nunit.engine.core/Internal/DomainDetailsBuilder.cs +++ b/src/NUnitEngine/nunit.engine.core/Internal/DomainDetailsBuilder.cs @@ -1,6 +1,5 @@ // Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt -#if !NETSTANDARD2_0 using System; using System.Collections.Generic; using System.Reflection; @@ -63,4 +62,3 @@ private static void WriteAssemblyInformation(StringBuilder sb, Assembly assembly } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/Internal/PathUtils.cs b/src/NUnitEngine/nunit.engine.core/Internal/PathUtils.cs index 659388949..205f12ab0 100644 --- a/src/NUnitEngine/nunit.engine.core/Internal/PathUtils.cs +++ b/src/NUnitEngine/nunit.engine.core/Internal/PathUtils.cs @@ -226,7 +226,7 @@ public static bool IsValidPath(string path) try { var info = GetFileSystemInfo(path); -#if NETCOREAPP2_1_OR_GREATER +#if NETCOREAPP var creation = info.CreationTime; #endif return true; // Whether it exists or not! diff --git a/src/NUnitEngine/nunit.engine.tests/Runners/MasterTestRunnerTests.cs b/src/NUnitEngine/nunit.engine.tests/Runners/MasterTestRunnerTests.cs index 69037b533..e4e924857 100644 --- a/src/NUnitEngine/nunit.engine.tests/Runners/MasterTestRunnerTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Runners/MasterTestRunnerTests.cs @@ -65,7 +65,7 @@ public MasterTestRunnerTests(TestRunData testRunData) // 1. These tests document current behavior. In some cases we may want to change that behavior. // 2. The .NET Standard build does not seem to handle notest-assembly correctly, so those entries are commented out. // 3. The .NET Standard build is not intended to handle projects. -#if NETCOREAPP2_1_OR_GREATER +#if NETCOREAPP new TestRunData( MOCK_ASSEMBLY, MockAssemblyData ), new TestRunData( $"{MOCK_ASSEMBLY},{MOCK_ASSEMBLY}", MockAssemblyData, MockAssemblyData ), //new TestRunData( "notest-assembly.dll", NoTestAssemblyData ), diff --git a/src/NUnitEngine/nunit.engine.tests/Services/TestFilteringTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/TestFilteringTests.cs index 528e7a051..71ff0a44b 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/TestFilteringTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/TestFilteringTests.cs @@ -16,8 +16,6 @@ public class TestFilteringTests #if NETCOREAPP3_1_OR_GREATER private NUnitNetCore31Driver _driver; -#elif NETCOREAPP2_1 - private NUnitNetStandardDriver _driver; #else private NUnit3FrameworkDriver _driver; #endif @@ -28,8 +26,6 @@ public void LoadAssembly() var mockAssemblyPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY); #if NETCOREAPP3_1_OR_GREATER _driver = new NUnitNetCore31Driver(); -#elif NETCOREAPP2_1 - _driver = new NUnitNetStandardDriver(); #else var assemblyName = typeof(NUnit.Framework.TestAttribute).Assembly.GetName(); _driver = new NUnit3FrameworkDriver(AppDomain.CurrentDomain, assemblyName); diff --git a/src/NUnitEngine/nunit.engine/Communication/Transports/Remoting/TestAgentRemotingProxy.cs b/src/NUnitEngine/nunit.engine/Communication/Transports/Remoting/TestAgentRemotingProxy.cs index fa17a0745..15793a6de 100644 --- a/src/NUnitEngine/nunit.engine/Communication/Transports/Remoting/TestAgentRemotingProxy.cs +++ b/src/NUnitEngine/nunit.engine/Communication/Transports/Remoting/TestAgentRemotingProxy.cs @@ -1,6 +1,5 @@ // Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt -#if !NETSTANDARD2_0 using System; using NUnit.Engine; @@ -39,4 +38,3 @@ public void Stop() } } } -#endif diff --git a/src/NUnitEngine/nunit.engine/Services/AgentStatus.cs b/src/NUnitEngine/nunit.engine/Services/AgentStatus.cs index 8a600d641..67911a74d 100644 --- a/src/NUnitEngine/nunit.engine/Services/AgentStatus.cs +++ b/src/NUnitEngine/nunit.engine/Services/AgentStatus.cs @@ -1,6 +1,5 @@ // Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt -#if !NETSTANDARD2_0 namespace NUnit.Engine.Services { /// @@ -28,4 +27,3 @@ public enum AgentStatus Terminated } } -#endif diff --git a/src/NUnitEngine/nunit.engine/Services/AgentStore.AgentRecord.cs b/src/NUnitEngine/nunit.engine/Services/AgentStore.AgentRecord.cs index 27246d80f..849b6cf24 100644 --- a/src/NUnitEngine/nunit.engine/Services/AgentStore.AgentRecord.cs +++ b/src/NUnitEngine/nunit.engine/Services/AgentStore.AgentRecord.cs @@ -1,6 +1,5 @@ // Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt -#if !NETSTANDARD2_0 using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -49,4 +48,3 @@ public AgentRecord Terminated() } } } -#endif diff --git a/src/NUnitEngine/nunit.engine/Services/AgentStore.cs b/src/NUnitEngine/nunit.engine/Services/AgentStore.cs index 6c7bd51f0..395992fa7 100644 --- a/src/NUnitEngine/nunit.engine/Services/AgentStore.cs +++ b/src/NUnitEngine/nunit.engine/Services/AgentStore.cs @@ -1,6 +1,5 @@ // Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt -#if !NETSTANDARD2_0 using System; using System.Collections.Generic; using System.Diagnostics; @@ -87,4 +86,3 @@ public void MarkTerminated(Guid agentId) } } } -#endif diff --git a/src/NUnitEngine/nunit.engine/Services/ExtensionService.cs b/src/NUnitEngine/nunit.engine/Services/ExtensionService.cs index 330fa9dad..f994c09b9 100644 --- a/src/NUnitEngine/nunit.engine/Services/ExtensionService.cs +++ b/src/NUnitEngine/nunit.engine/Services/ExtensionService.cs @@ -5,17 +5,7 @@ using System.Reflection; using NUnit.Engine.Extensibility; using NUnit.Engine.Internal; -using NUnit.Engine.Internal.Backports; using NUnit.Engine.Internal.FileSystemAccess; -using NUnit.Engine.Internal.FileSystemAccess.Default; -using TestCentric.Metadata; - -using Backports = NUnit.Engine.Internal.Backports; -#if NET20 || NETSTANDARD2_0 -using Path = NUnit.Engine.Internal.Backports.Path; -#else -using Path = System.IO.Path; -#endif namespace NUnit.Engine.Services {