Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Updating dotnet new test so that it does not use project dependencies…
Browse files Browse the repository at this point in the history
… and honors package dependencies.
  • Loading branch information
livarcocc committed Aug 9, 2016
1 parent 034f8b6 commit fa29a28
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/dotnet-new.Tests/GivenThatIWantANewCSxUnitProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,20 @@ public void When_xUnit_project_created_Then_project_restores()
[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();
Expand Down

0 comments on commit fa29a28

Please sign in to comment.