Skip to content

Commit 200b66d

Browse files
authored
Incompatible framework message fix (#2059)
* Fix the error reported for incompatible framework to give complete framework name. * Fixing the unit tests * Fixed acceptance test
1 parent c09eb2b commit 200b66d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ public static IEnumerable<String> FilterCompatibleSources(Architecture chosenPla
629629
string incompatiblityMessage;
630630
var onlyFileName = Path.GetFileName(source);
631631
// Add message for incompatible sources.
632-
incompatiblityMessage = string.Format(CultureInfo.CurrentCulture, OMResources.SourceIncompatible, onlyFileName, actualFramework.Version, actualPlatform);
632+
incompatiblityMessage = string.Format(CultureInfo.CurrentCulture, OMResources.SourceIncompatible, onlyFileName, actualFramework.Name, actualPlatform);
633633

634634
warnings.AppendLine(incompatiblityMessage);
635635
incompatiblityFound = true;

test/Microsoft.TestPlatform.AcceptanceTests/ExecutionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public void UnhandleExceptionExceptionShouldBeLoggedToDiagLogFile(RunnerInfo run
217217
public void IncompatibleSourcesWarningShouldBeDisplayedInTheConsole(RunnerInfo runnerInfo)
218218
{
219219
AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo);
220-
var expectedWarningContains = @"Following DLL(s) do not match framework/platform settings. SimpleTestProject3.dll is built for Framework 4.5.1 and Platform X64";
220+
var expectedWarningContains = @"Following DLL(s) do not match framework/platform settings. SimpleTestProject3.dll is built for Framework .NETFramework,Version=v4.5.1 and Platform X64";
221221
var assemblyPaths =
222222
this.BuildMultipleAssemblyPath("SimpleTestProject3.dll", "SimpleTestProjectx86.dll").Trim('\"');
223223
var arguments = PrepareArguments(assemblyPaths, this.GetTestAdapterPath(), string.Empty, this.FrameworkArgValue, runnerInfo.InIsolationValue);

test/Microsoft.TestPlatform.Utilities.UnitTests/InferRunSettingsHelperTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ public void RunSettingsWithDisabledCollectionSettingsAndInlineTestSettingsXml()
736736

737737
private string GetSourceIncompatibleMessage(string source)
738738
{
739-
return string.Format(CultureInfo.CurrentCulture, OMResources.SourceIncompatible, source, sourceFrameworks[source].Version, sourceArchitectures[source]);
739+
return string.Format(CultureInfo.CurrentCulture, OMResources.SourceIncompatible, source, sourceFrameworks[source].Name, sourceArchitectures[source]);
740740
}
741741

742742
private XmlDocument GetXmlDocument(string settingsXml)

0 commit comments

Comments
 (0)