Merge pull request #2700 from eerhardt/FixFilePath

"dotnet test project.json" fails in a directory with a test project.json in it
This commit is contained in:
Eric Erhardt 2016-04-28 12:32:51 -05:00
commit 38d0c28a1e
9 changed files with 140 additions and 24 deletions

View file

@ -43,6 +43,20 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
.Pass();
}
[Fact]
public void It_builds_projects_with_a_local_project_json_path()
{
var testInstance = TestAssetsManager
.CreateTestInstance("TestAppSimple")
.WithLockFiles();
new BuildCommand("project.json")
.WithWorkingDirectory(testInstance.TestRoot)
.ExecuteWithCapturedOutput()
.Should()
.Pass();
}
[Fact]
public void It_builds_projects_with_xmlDoc_and_spaces_in_the_path()
{

View file

@ -136,6 +136,20 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
zip.Entries.Should().Contain(e => e.FullName == "lib/netstandard1.5/MyLibrary.pdb");
}
[Fact]
public void PackWorksWithLocalProjectJson()
{
var testInstance = TestAssetsManager
.CreateTestInstance("TestAppSimple")
.WithLockFiles();
new PackCommand(Project.FileName)
.WithWorkingDirectory(testInstance.TestRoot)
.Execute()
.Should()
.Pass();
}
private void CopyProjectToTempDir(string projectDir, TempDirectory tempDir)
{
// copy all the files to temp dir

View file

@ -360,5 +360,18 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
command.Execute($"publish {temp}").Should().Fail();
}
}
[Fact]
public void PublishWorksWithLocalProjectJson()
{
TestInstance instance = TestAssetsManager.CreateTestInstance("TestAppSimple")
.WithLockFiles();
new PublishCommand("project.json")
.WithWorkingDirectory(instance.TestRoot)
.Execute()
.Should()
.Pass();
}
}
}

View file

@ -68,6 +68,21 @@ namespace Microsoft.DotNet.Tools.Run.Tests
new RunCommand(instance.TestRoot).Execute().Should().Pass();
}
[Fact]
public void ItRunsWithLocalProjectJsonArg()
{
TestInstance instance = TestAssetsManager.CreateTestInstance("TestAppSimple")
.WithLockFiles()
.WithBuildArtifacts();
new RunCommand("project.json")
.WithWorkingDirectory(instance.TestRoot)
.ExecuteWithCapturedOutput()
.Should()
.Pass()
.And
.HaveStdOutContaining("Hello World!");
}
[Fact]
public void ItRunsAppsThatOutputUnicodeCharacters()
{

View file

@ -55,6 +55,18 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
result.Should().Pass();
}
[Fact]
public void It_runs_tests_for_a_local_project_json()
{
string projectDirectory = Path.GetDirectoryName(_projectFilePath);
new DotnetTestCommand()
.WithWorkingDirectory(projectDirectory)
.Execute("project.json")
.Should()
.Pass();
}
[Fact]
public void It_builds_the_project_using_the_output_passed()
{