Reading DisableAppDomain Setting from the testplatform runsettings
TestPlatform can send DisableAppDomain setting to adapters.
When DisableAppDomain is true Will set "DomainUsage" to "None"
MODIFY
src/NUnitTestAdapter/AdapterSettings.cs
src/NUnitTestAdapter/AdapterSettings.cs
@@ -57,6 +57,8 @@ namespace NUnit.VisualStudio.TestAdapter
public bool CollectSourceInformation { get; private set; }
+ public bool DisableAppDomain { get; private set; }
+
#endregion
#region Properties - TestRunParameters
@@ -128,6 +130,7 @@ namespace NUnit.VisualStudio.TestAdapter
TargetFrameworkVersion = GetInnerText(runConfiguration, "TargetFrameworkVersion");
TestAdapterPaths = GetInnerText(runConfiguration, "TestAdapterPaths");
CollectSourceInformation = GetInnerTextAsBool(runConfiguration, "CollectSourceInformation", true);
+ DisableAppDomain = GetInnerTextAsBool(runConfiguration, "DisableAppDomain", false);
TestProperties = new Dictionary<string, string>();
foreach (XmlNode node in doc.SelectNodes("RunSettings/TestRunParameters/Parameter"))
@@ -178,6 +181,12 @@ namespace NUnit.VisualStudio.TestAdapter
DomainUsage = "None";
SynchronousEvents = true;
}
+
+ // If DisableAppDomain settings is passed from the testplatform, set the DomainUsage to None.
+ if(DisableAppDomain)
+ {
+ DomainUsage = "None";
+ }
}
public void SaveRandomSeed(string dirname)

MODIFY
src/NUnitTestAdapterTests/AdapterSettingsTests.cs
src/NUnitTestAdapterTests/AdapterSettingsTests.cs
@@ -50,6 +50,7 @@ namespace NUnit.VisualStudio.TestAdapter.Tests
Assert.False(_settings.SynchronousEvents);
Assert.Null(_settings.DomainUsage);
Assert.False(_settings.InProcDataCollectorsAvailable);
+ Assert.IsFalse(_settings.DisableAppDomain);
}
[Test]
@@ -94,6 +95,13 @@ namespace NUnit.VisualStudio.TestAdapter.Tests
Assert.That(_settings.CollectSourceInformation, Is.EqualTo(false));
}
+ [Test]
+ public void DisableAppDomainSetting()
+ {
+ _settings.Load("<RunSettings><RunConfiguration><DisableAppDomain>true</DisableAppDomain></RunConfiguration></RunSettings>");
+ Assert.That(_settings.DisableAppDomain, Is.EqualTo(true));
+ }
+
[Test]
public void TestRunParameterSettings()
{

Reading DisableAppDomain Setting from the testplatform runsettings

- TestPlatform can send DisableAppDomain setting to adapters.
- When DisableAppDomain is true Will set "DomainUsage" to "None"