Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ public static RunConfiguration FromXml(XmlReader reader)
if (!bool.TryParse(element, out boolValue))
{
throw new SettingsException(string.Format(CultureInfo.CurrentCulture,
Resources.Resources.InvalidSettingsIncorrectValue, Constants.RunConfigurationSettingsName, boolValue, elementName));
Resources.Resources.InvalidSettingsIncorrectValue, Constants.RunConfigurationSettingsName, element, elementName));
}
Comment on lines 1024 to 1034

runConfiguration.DisableSharedTestHost = boolValue;
Expand All @@ -1046,7 +1046,7 @@ public static RunConfiguration FromXml(XmlReader reader)
if (!bool.TryParse(element, out boolValue))
{
throw new SettingsException(string.Format(CultureInfo.CurrentCulture,
Resources.Resources.InvalidSettingsIncorrectValue, Constants.RunConfigurationSettingsName, boolValue, elementName));
Resources.Resources.InvalidSettingsIncorrectValue, Constants.RunConfigurationSettingsName, element, elementName));
}
Comment thread
nohwnd marked this conversation as resolved.
Resolved

runConfiguration.SkipDefaultAdapters = boolValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo(
EqtTrace.Verbose($"DotnetTestHostmanager: Searching muxer for the architecture '{targetArchitecture}', OS '{_platformEnvironment.OperatingSystem}' framework '{_targetFramework}' SDK platform architecture '{_platformEnvironment.Architecture}'");
if (forceToX64)
{
EqtTrace.Verbose($"DotnetTestHostmanager: Forcing the search to x64 architecure, IsDefaultTargetArchitecture '{_isDefaultTargetArchitecture}' OS '{_platformEnvironment.OperatingSystem}' framework '{_targetFramework}'");
EqtTrace.Verbose($"DotnetTestHostmanager: Forcing the search to x64 architecture, IsTargetPlatformInferred '{_isDefaultTargetArchitecture}' OS '{_platformEnvironment.OperatingSystem}' framework '{_targetFramework}'");
}

// Check if DOTNET_ROOT resolution should be bypassed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,4 +447,36 @@ public void RunConfigurationFromXmlThrowsSettingsExceptionIfIsTargetPlatformInfe
Assert.ThrowsExactly<SettingsException>(
() => XmlRunSettingsUtilities.GetRunConfigurationNode(settingsXml));
}

[TestMethod]
public void RunConfigurationFromXmlThrowsSettingsExceptionIfDisableSharedTestHostIsInvalid()
{
string settingsXml =
@"<?xml version=""1.0"" encoding=""utf-8""?>
Comment thread
nohwnd marked this conversation as resolved.
Resolved
<RunSettings>
<RunConfiguration>
<DisableSharedTestHost>InvalidValue</DisableSharedTestHost>
</RunConfiguration>
</RunSettings>";

var exception = Assert.ThrowsExactly<SettingsException>(
() => XmlRunSettingsUtilities.GetRunConfigurationNode(settingsXml));
Assert.AreEqual("Invalid settings 'RunConfiguration'. Invalid value 'InvalidValue' specified for 'DisableSharedTestHost'.", exception.Message);
}

[TestMethod]
public void RunConfigurationFromXmlThrowsSettingsExceptionIfSkipDefaultAdaptersIsInvalid()
{
string settingsXml =
@"<?xml version=""1.0"" encoding=""utf-8""?>
<RunSettings>
<RunConfiguration>
<SkipDefaultAdapters>InvalidValue</SkipDefaultAdapters>
</RunConfiguration>
</RunSettings>";

var exception = Assert.ThrowsExactly<SettingsException>(
() => XmlRunSettingsUtilities.GetRunConfigurationNode(settingsXml));
Assert.AreEqual("Invalid settings 'RunConfiguration'. Invalid value 'InvalidValue' specified for 'SkipDefaultAdapters'.", exception.Message);
}
}