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:
commit
38d0c28a1e
9 changed files with 140 additions and 24 deletions
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue