Adding one more test to ensure that migrate global.json will continue to target only projects under the global.json's project node.
This commit is contained in:
parent
cdf91f2f30
commit
7f4273d4b1
2 changed files with 26 additions and 1 deletions
|
@ -25,6 +25,31 @@ namespace Microsoft.DotNet.Migration.Tests
|
|||
.Pass();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenUsingGlobalJsonItOnlyMigratesProjectsInTheGlobalJsonNode()
|
||||
{
|
||||
var solutionDirectory =
|
||||
TestAssetsManager.CreateTestInstance("AppWithPackageNamedAfterFolder").Path;
|
||||
var globalJsonPath = Path.Combine(solutionDirectory, "global.json");
|
||||
|
||||
new TestCommand("dotnet")
|
||||
.WithForwardingToConsole()
|
||||
.Execute($"migrate {globalJsonPath}")
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
new DirectoryInfo(solutionDirectory)
|
||||
.Should().HaveFiles(new []
|
||||
{
|
||||
Path.Combine("src", "App", "App.csproj"),
|
||||
Path.Combine("test", "App.Tests", "App.Tests.csproj"),
|
||||
Path.Combine("TestAssets", "TestAsset", "project.json")
|
||||
});
|
||||
|
||||
new DirectoryInfo(solutionDirectory)
|
||||
.Should().NotHaveFile(Path.Combine("TestAssets", "TestAsset", "TestAsset.csproj"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItMigratesWhenBeingPassedJustGlobalJson()
|
||||
{
|
||||
|
|
|
@ -168,7 +168,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
|||
{
|
||||
var solutionDirectory =
|
||||
TestAssetsManager.CreateTestInstance("AppWithPackageNamedAfterFolder").Path;
|
||||
var appProject = Path.Combine(solutionDirectory, "App", "App.csproj");
|
||||
var appProject = Path.Combine(solutionDirectory, "src", "App", "App.csproj");
|
||||
|
||||
MigrateProject(solutionDirectory);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue