Ensure dotnet restore --packages is working (#5008)

* add dotnet restore --packages tests

* add dotnet build, publish, pack, dotnet-test test

* Shorten the test name in attempt to fix test failure

* fix whitespaces
This commit is contained in:
Krzysztof Wicher 2016-12-18 00:45:25 -08:00 committed by Piotr Puszkiewicz
parent 9ad164a9dd
commit 476a83eb1a
9 changed files with 341 additions and 4 deletions

View file

@ -139,5 +139,36 @@ namespace Microsoft.DotNet.Cli.Test.Tests
Directory.Delete(trxLoggerDirectory, true);
}
}
[Fact(Skip = "https://github.com/dotnet/cli/issues/5035")]
public void ItBuildsAndTestsAppWhenRestoringToSpecificDirectory()
{
var rootPath = TestAssets.Get("VSTestDotNetCore").CreateInstance().WithSourceFiles().Root.FullName;
string dir = "pkgs";
string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir));
string args = $"--packages \"{dir}\"";
new RestoreCommand()
.WithWorkingDirectory(rootPath)
.Execute(args)
.Should()
.Pass();
new BuildCommand()
.WithWorkingDirectory(rootPath)
.ExecuteWithCapturedOutput()
.Should()
.Pass()
.And.NotHaveStdErr();
CommandResult result = new DotnetTestCommand()
.WithWorkingDirectory(rootPath)
.ExecuteWithCapturedOutput();
result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.");
result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest");
result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTest");
}
}
}