Updating dotnet new test so that it does not use project dependencies and honors package dependencies.
This commit is contained in:
parent
7b94fa7df2
commit
8fa2d35291
1 changed files with 7 additions and 3 deletions
|
@ -36,16 +36,20 @@ namespace Microsoft.DotNet.Tests
|
|||
[Fact]
|
||||
public void When_dotnet_test_is_invoked_Then_tests_run_without_errors()
|
||||
{
|
||||
const string testFolder = "test";
|
||||
var rootPath = Temp.CreateDirectory().Path;
|
||||
var testDirectory = Directory.CreateDirectory(Path.Combine(rootPath, testFolder)).FullName;
|
||||
|
||||
new TestCommand("dotnet") { WorkingDirectory = rootPath }
|
||||
File.WriteAllText(Path.Combine(rootPath, "global.json"), $"{{ \"projects\": [\"{testFolder}\"] }}");
|
||||
|
||||
new TestCommand("dotnet") { WorkingDirectory = testDirectory }
|
||||
.Execute("new --type xunittest");
|
||||
|
||||
new TestCommand("dotnet") { WorkingDirectory = rootPath }
|
||||
new TestCommand("dotnet") { WorkingDirectory = testDirectory }
|
||||
.Execute("restore");
|
||||
|
||||
var buildResult = new TestCommand("dotnet")
|
||||
.WithWorkingDirectory(rootPath)
|
||||
.WithWorkingDirectory(testDirectory)
|
||||
.ExecuteWithCapturedOutput("test")
|
||||
.Should()
|
||||
.Pass();
|
||||
|
|
Loading…
Reference in a new issue