diff --git a/TestAssets/TestProjects/ProjectsWithTests/MultipleFrameworkProject/GivenThatIWantSomeFakeTests.cs b/TestAssets/TestProjects/ProjectsWithTests/MultipleFrameworkProject/GivenThatIWantSomeFakeTests.cs index 6f2f5ebc8..4be559988 100644 --- a/TestAssets/TestProjects/ProjectsWithTests/MultipleFrameworkProject/GivenThatIWantSomeFakeTests.cs +++ b/TestAssets/TestProjects/ProjectsWithTests/MultipleFrameworkProject/GivenThatIWantSomeFakeTests.cs @@ -8,14 +8,14 @@ namespace FakeTests { public class GivenThatIWantSomeFakeTests { -#if NET451 +#if NET46 [Fact] - public void NET451_succeeds() + public void NET46_succeeds() { Assert.True(true); } - [Fact(Skip="Skipped for NET451")] + [Fact(Skip="Skipped for NET46")] public void SkippedTest() { @@ -45,8 +45,8 @@ namespace FakeTests { var shouldFail = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_TEST_SHOULD_FAIL")); -#if NET451 - Assert.True(shouldFail, "Failing in NET451"); +#if NET46 + Assert.True(shouldFail, "Failing in NET46"); #else Assert.True(shouldFail, "Failing in NETCOREAPP1.0"); #endif diff --git a/TestAssets/TestProjects/ProjectsWithTests/MultipleFrameworkProject/project.json b/TestAssets/TestProjects/ProjectsWithTests/MultipleFrameworkProject/project.json index 9c6f64cbe..62abd5eb1 100644 --- a/TestAssets/TestProjects/ProjectsWithTests/MultipleFrameworkProject/project.json +++ b/TestAssets/TestProjects/ProjectsWithTests/MultipleFrameworkProject/project.json @@ -20,7 +20,11 @@ "System.Runtime.Serialization.Primitives": "4.1.1" } }, - "net46": {} + "net46": { + "dependencies": { + "System.IO.FileSystem": "4.0.1" + } + } }, "testRunner": "xunit" } diff --git a/test/dotnet-test.Tests/GivenThatWeWantToRunTestsForMultipleTFMsInTheConsole.cs b/test/dotnet-test.Tests/GivenThatWeWantToRunTestsForMultipleTFMsInTheConsole.cs index 0662cde3f..8f746ea8f 100644 --- a/test/dotnet-test.Tests/GivenThatWeWantToRunTestsForMultipleTFMsInTheConsole.cs +++ b/test/dotnet-test.Tests/GivenThatWeWantToRunTestsForMultipleTFMsInTheConsole.cs @@ -17,7 +17,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests { private readonly string _projectFilePath; private readonly string _defaultNetCoreAppOutputPath; - private readonly string _defaultNet451OutputPath; + private readonly string _defaultNet46OutputPath; public GivenThatWeWantToRunTestsForMultipleTFMsInTheConsole() { @@ -36,7 +36,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests new RestoreCommand() { WorkingDirectory = testInstance.TestRoot }.Execute().Should().Pass(); _defaultNetCoreAppOutputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "netcoreapp1.0"); - _defaultNet451OutputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "net451", RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers().First()); + _defaultNet46OutputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "net46", RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers().First()); } [WindowsOnlyFact] @@ -46,18 +46,18 @@ namespace Microsoft.Dotnet.Tools.Test.Tests var result = testCommand .ExecuteWithCapturedOutput($"{_projectFilePath}"); result.Should().Pass(); - result.StdOut.Should().Contain("Skipped for NET451"); + result.StdOut.Should().Contain("Skipped for NET46"); result.StdOut.Should().Contain("Skipped for NETCOREAPP1.0"); } [WindowsOnlyFact] - public void It_builds_and_runs_tests_for_net451() + public void It_builds_and_runs_tests_for_net46() { var testCommand = new DotnetTestCommand(); var result = testCommand - .ExecuteWithCapturedOutput($"{_projectFilePath} -f net451"); + .ExecuteWithCapturedOutput($"{_projectFilePath} -f net46"); result.Should().Pass(); - result.StdOut.Should().Contain($"Skipped for NET451"); + result.StdOut.Should().Contain($"Skipped for NET46"); result.StdOut.Should().NotContain($"Skipped for NETCOREAPP1.0"); } @@ -69,7 +69,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests .ExecuteWithCapturedOutput($"{_projectFilePath} -f netcoreapp1.0"); result.Should().Pass(); result.StdOut.Should().Contain($"Skipped for NETCOREAPP1.0"); - result.StdOut.Should().NotContain($"Skipped for NET451"); + result.StdOut.Should().NotContain($"Skipped for NET46"); } [Fact] @@ -103,15 +103,15 @@ namespace Microsoft.Dotnet.Tools.Test.Tests } [WindowsOnlyFact] - public void It_skips_build_when_the_no_build_flag_is_passed_for_net451() + public void It_skips_build_when_the_no_build_flag_is_passed_for_net46() { var rid = RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers().First(); var buildCommand = new BuildCommand(_projectFilePath); - var result = buildCommand.Execute($"-f net451 -r {rid} -o {_defaultNet451OutputPath}"); + var result = buildCommand.Execute($"-f net46 -r {rid} -o {_defaultNet46OutputPath}"); result.Should().Pass(); var testCommand = new DotnetTestCommand(); - result = testCommand.Execute($"{_projectFilePath} -f net451 -r {rid} -o {_defaultNet451OutputPath} --no-build"); + result = testCommand.Execute($"{_projectFilePath} -f net46 -r {rid} -o {_defaultNet46OutputPath} --no-build"); result.Should().Pass(); } @@ -142,7 +142,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests .ExecuteWithCapturedOutput($"{_projectFilePath}"); result.Should().Fail(); - result.StdOut.Should().Contain("Failing in NET451"); + result.StdOut.Should().Contain("Failing in NET46"); result.StdOut.Should().Contain("Failing in NETCOREAPP1.0"); } diff --git a/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTimeForMultipleTFms.cs b/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTimeForMultipleTFms.cs index 8b55fa4fd..64fe2db58 100644 --- a/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTimeForMultipleTFms.cs +++ b/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTimeForMultipleTFms.cs @@ -18,7 +18,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests { private string _projectFilePath; private string _netCoreAppOutputPath; - private string _net451OutputPath; + private string _net46OutputPath; private void Setup([CallerMemberName] string callingMethod = "") { @@ -44,8 +44,8 @@ namespace Microsoft.Dotnet.Tools.Test.Tests if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) { var rid = RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers().First(); - _net451OutputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "net451", rid); - result = buildCommand.Execute($"-f net451 -r {rid} -o {_net451OutputPath}"); + _net46OutputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "net46", rid); + result = buildCommand.Execute($"-f net46 -r {rid} -o {_net46OutputPath}"); result.Should().Pass(); } } @@ -70,7 +70,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests } [WindowsOnlyFact(Skip="https://github.com/xunit/xunit/issues/934")] - public void It_discovers_tests_for_the_ProjectWithTestsWithNet451() + public void It_discovers_tests_for_the_ProjectWithTestsWithNet46() { Setup(); @@ -80,7 +80,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests var rid = RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers().First(); var testCommand = new DotnetTestCommand(); - var result = testCommand.Execute($"{_projectFilePath} -f net451 -r {rid} -o {_net451OutputPath} --port {adapter.Port} --no-build"); + var result = testCommand.Execute($"{_projectFilePath} -f net46 -r {rid} -o {_net46OutputPath} --port {adapter.Port} --no-build"); result.Should().Pass(); adapter.Messages["TestSession.Connected"].Count.Should().Be(1); @@ -111,7 +111,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests } [WindowsOnlyFact(Skip="https://github.com/xunit/xunit/issues/934")] - public void It_runs_tests_for_net451() + public void It_runs_tests_for_net46() { Setup(); @@ -121,7 +121,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests var testCommand = new DotnetTestCommand(); var rid = RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers().First(); - var result = testCommand.Execute($"{_projectFilePath} -f net451 -r {rid} -o {_net451OutputPath} --port {adapter.Port} --no-build"); + var result = testCommand.Execute($"{_projectFilePath} -f net46 -r {rid} -o {_net46OutputPath} --port {adapter.Port} --no-build"); result.Should().Pass(); adapter.Messages["TestSession.Connected"].Count.Should().Be(1);