Identifying the DisableParallelization specified or not.
MODIFY
src/NUnitTestAdapter/NUnitTestAdapter.cs
src/NUnitTestAdapter/NUnitTestAdapter.cs
@@ -90,21 +90,7 @@ namespace NUnit.VisualStudio.TestAdapter
public static bool IsRunningUnderIDE
{
- get
- {
- if (exeName == null)
- {
- Assembly entryAssembly = Assembly.GetEntryAssembly();
- if (entryAssembly != null)
- exeName = entryAssembly.Location;
-
- }
-
- return exeName != null && (
- exeName.Contains("vstest.executionengine") ||
- exeName.Contains("vstest.discoveryengine") ||
- exeName.Contains("TE.ProcessHost"));
- }
+ get; private set;
}
#endregion
@@ -125,6 +111,7 @@ namespace NUnit.VisualStudio.TestAdapter
{
Settings.Load(context);
TestLog.Verbosity = Settings.Verbosity;
+ IsRunningUnderIDE = Settings.DesignMode;
}
catch (Exception e)
{

MODIFY
src/NUnitTestAdapterTests/AdapterSettingsTests.cs
src/NUnitTestAdapterTests/AdapterSettingsTests.cs
@@ -52,7 +52,7 @@ namespace NUnit.VisualStudio.TestAdapter.Tests
Assert.Null(_settings.DomainUsage);
Assert.False(_settings.InProcDataCollectorsAvailable);
Assert.IsFalse(_settings.DisableAppDomain);
- Assert.IsFalse(_settings.DisableParallelization);
+ Assert.IsFalse(_settings.DisableParallelization.HasValue);
Assert.IsFalse(_settings.DesignMode);
}
@@ -119,6 +119,12 @@ namespace NUnit.VisualStudio.TestAdapter.Tests
// When there's a conflicting values in DisableParallelization and NumberOfTestWorkers. Falling back to DisableParallelization setting.
Assert.That(_settings.NumberOfTestWorkers, Is.EqualTo(0));
+
+ _settings.Load("<RunSettings><RunConfiguration><DisableParallelization>false</DisableParallelization></RunConfiguration><NUnit><NumberOfTestWorkers>0</NumberOfTestWorkers></NUnit></RunSettings>");
+ Assert.That(_settings.NumberOfTestWorkers, Is.EqualTo(-1));
+
+ _settings.Load("<RunSettings><RunConfiguration></RunConfiguration><NUnit><NumberOfTestWorkers>12</NumberOfTestWorkers></NUnit></RunSettings>");
+ Assert.That(_settings.NumberOfTestWorkers, Is.EqualTo(12));
}
[Test]

Identifying the DisableParallelization specified or not.