Update test code to use netcoreapp2.1

This commit is contained in:
Daniel Plaisted 2017-08-18 15:36:01 -07:00
parent c00afe9588
commit dc4046ca7e
14 changed files with 30 additions and 30 deletions

View file

@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
{
string projectDirectory = directory.Path;
string newArgs = "console -f netcoreapp2.0 --debug:ephemeral-hive --no-restore";
string newArgs = "console -f netcoreapp2.1 --debug:ephemeral-hive --no-restore";
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute(newArgs)
@ -112,7 +112,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes)
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput(
$"-d dependency-tool-invoker -c {configuration} -f netcoreapp2.0 portable")
$"-d dependency-tool-invoker -c {configuration} -f netcoreapp2.1 portable")
.Should().Pass()
.And.HaveStdOutContaining("Hello Portable World!");;
}

View file

@ -198,7 +198,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
var command = factory.Create("dotnet-tool-with-output-name", null);
command.CommandArgs.Should().Contain(
Path.Combine("toolwithoutputname", "1.0.0", "lib", "netcoreapp2.0", "dotnet-tool-with-output-name.dll"));
Path.Combine("toolwithoutputname", "1.0.0", "lib", "netcoreapp2.1", "dotnet-tool-with-output-name.dll"));
}
}
}

View file

@ -375,7 +375,7 @@ namespace Microsoft.DotNet.Tests
"dotnet-fallbackfoldertool",
"1.0.0",
"lib",
"netcoreapp2.0",
"netcoreapp2.1",
"dotnet-fallbackfoldertool.dll"));
}

View file

@ -107,7 +107,7 @@ namespace Microsoft.DotNet.Cli.Package.Add.Tests
var packageName = "Newtonsoft.Json";
var packageVersion = "9.0.1";
var framework = "netcoreapp2.0";
var framework = "netcoreapp2.1";
var cmd = new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput($"add package {packageName} --version {packageVersion} --framework {framework}");

View file

@ -29,7 +29,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
var outputDll = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.0")
var outputDll = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.1")
.GetFile($"{testAppName}.dll");
var outputRunCommand = new DotnetCommand();
@ -66,7 +66,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests
new BuildCommand()
.WithWorkingDirectory(projectDirectory)
.Execute("--framework netcoreapp2.0")
.Execute("--framework netcoreapp2.1")
.Should().Pass();
}
@ -93,7 +93,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests
string dir = "pkgs";
string args = $"--packages {dir}";
string newArgs = $"console -f netcoreapp2.0 -o \"{rootPath}\" --debug:ephemeral-hive --no-restore";
string newArgs = $"console -f netcoreapp2.1 -o \"{rootPath}\" --debug:ephemeral-hive --no-restore";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute(newArgs)
@ -115,7 +115,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
var outputDll = Directory.EnumerateFiles(
Path.Combine(rootPath, "bin", configuration, "netcoreapp2.0"), "*.dll",
Path.Combine(rootPath, "bin", configuration, "netcoreapp2.1"), "*.dll",
SearchOption.TopDirectoryOnly)
.Single();

View file

@ -28,7 +28,7 @@ namespace Microsoft.DotNet.Cli.Clean.Tests
.Should().Pass();
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
var outputFolder = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.0", "win7-x64");
var outputFolder = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.1", "win7-x64");
outputFolder.Should().NotBeEmpty();

View file

@ -33,11 +33,11 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
new PublishCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("--framework netcoreapp2.0")
.Execute("--framework netcoreapp2.1")
.Should().Pass();
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, "netcoreapp2.0", "publish", $"{testAppName}.dll");
var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, "netcoreapp2.1", "publish", $"{testAppName}.dll");
new DotnetCommand()
.ExecuteWithCapturedOutput(outputDll)
@ -57,7 +57,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
new PublishCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("--framework netcoreapp2.0")
.Execute("--framework netcoreapp2.1")
.Should().Pass();
}
@ -74,7 +74,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
new PublishCommand()
.WithWorkingDirectory(projectDirectory)
.Execute("--framework netcoreapp2.0")
.Execute("--framework netcoreapp2.1")
.Should().Pass();
}
@ -90,7 +90,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
new PublishCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--framework netcoreapp2.0 --no-restore")
.ExecuteWithCapturedOutput("--framework netcoreapp2.1 --no-restore")
.Should().Fail()
.And.HaveStdOutContaining("project.assets.json");
}
@ -110,7 +110,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
new PublishCommand()
.WithFramework("netcoreapp2.0")
.WithFramework("netcoreapp2.1")
.WithRuntime(rid)
.WithWorkingDirectory(testProjectDirectory)
.Execute()
@ -119,7 +119,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
var outputProgram = testProjectDirectory
.GetDirectory("bin", configuration, "netcoreapp2.0", rid, "publish", $"{testAppName}{Constants.ExeSuffix}")
.GetDirectory("bin", configuration, "netcoreapp2.1", rid, "publish", $"{testAppName}{Constants.ExeSuffix}")
.FullName;
EnsureProgramIsRunnable(outputProgram);
@ -185,7 +185,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
return testProjectDirectory
.GetDirectory("bin", configuration, "netcoreapp2.0", rid, "publish");
.GetDirectory("bin", configuration, "netcoreapp2.1", rid, "publish");
}
private static void EnsureProgramIsRunnable(string path)
@ -227,7 +227,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
var outputProgram = rootDir
.GetDirectory("bin", configuration, "netcoreapp2.0", "publish", $"{rootDir.Name}.dll")
.GetDirectory("bin", configuration, "netcoreapp2.1", "publish", $"{rootDir.Name}.dll")
.FullName;
new TestCommand(outputProgram)

View file

@ -70,7 +70,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests
new RunCommand()
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput("--framework netcoreapp2.0")
.ExecuteWithCapturedOutput("--framework netcoreapp2.1")
.Should().Pass()
.And.HaveStdOutContaining("This string came from the test library!");
}
@ -131,7 +131,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests
new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--framework netcoreapp2.0")
.ExecuteWithCapturedOutput("--framework netcoreapp2.1")
.Should().Pass()
.And.HaveStdOutContaining("Hello World!");
}

View file

@ -13,7 +13,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
{
public class GivenDotnetStoresAndPublishesProjects : TestBase
{
private static string _tfm = "netcoreapp2.0";
private static string _tfm = "netcoreapp2.1";
private static string _frameworkVersion = TestAssetInstance.CurrentRuntimeFrameworkVersion;
private static string _arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant();

View file

@ -40,8 +40,8 @@ namespace Microsoft.DotNet.Cli.Test.Tests
result.StdOut
.Should().Contain("Total tests: 3. Passed: 2. Failed: 1. Skipped: 0.", "because .NET 4.6 tests will pass")
.And.Contain("Passed TestNamespace.VSTestTests.VSTestPassTestDesktop", "because .NET 4.6 tests will pass")
.And.Contain("Total tests: 3. Passed: 1. Failed: 2. Skipped: 0.", "because netcoreapp2.0 tests will fail")
.And.Contain("Failed TestNamespace.VSTestTests.VSTestFailTestNetCoreApp", "because netcoreapp2.0 tests will fail");
.And.Contain("Total tests: 3. Passed: 1. Failed: 2. Skipped: 0.", "because netcoreapp2.1 tests will fail")
.And.Contain("Failed TestNamespace.VSTestTests.VSTestFailTestNetCoreApp", "because netcoreapp2.1 tests will fail");
}
result.ExitCode.Should().Be(1);
}
@ -97,7 +97,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests
new DotnetTestCommand()
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --framework netcoreapp2.0")
.ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --framework netcoreapp2.1")
.Should().Pass();
}
}

View file

@ -117,7 +117,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests
var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("5");
string configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
string expectedError = Path.Combine(testProjectDirectory, "bin",
configuration, "netcoreapp2.0", "VSTestCore.dll");
configuration, "netcoreapp2.1", "VSTestCore.dll");
expectedError = "The test source file " + "\"" + expectedError + "\"" + " provided was not found.";
// Call test

View file

@ -31,7 +31,7 @@ namespace Microsoft.DotNet.Cli.VSTest.Tests
.Should().Pass();
var outputDll = testRoot
.GetDirectory("bin", configuration, "netcoreapp2.0")
.GetDirectory("bin", configuration, "netcoreapp2.1")
.GetFile($"{testAppName}.dll");
var argsForVstest = $"\"{outputDll.FullName}\" --logger:console;verbosity=normal";

View file

@ -57,7 +57,7 @@ namespace Microsoft.DotNet.Tests
_testInstance.Root.FullName,
"bin",
configuration,
"netcoreapp2.0",
"netcoreapp2.1",
"publish",
"VBTestApp.dll");

View file

@ -175,7 +175,7 @@ namespace Microsoft.DotNet.Tests
".tools",
toolName);
// Other tests may have restored the tool for netcoreapp2.0, so delete its tools folder
// Other tests may have restored the tool for netcoreapp2.1, so delete its tools folder
if (Directory.Exists(toolFolder))
{
Directory.Delete(toolFolder, true);
@ -423,7 +423,7 @@ namespace Microsoft.DotNet.Tests
.WithRestoreFiles();
var assetsFile = new DirectoryInfo(new RepoDirectoriesProvider().NugetPackages)
.GetDirectory(".tools", "dotnet-portable", "1.0.0", "netcoreapp2.0")
.GetDirectory(".tools", "dotnet-portable", "1.0.0", "netcoreapp2.1")
.GetFile("project.assets.json");
var stopWatch = Stopwatch.StartNew();