public void WhenMigratingDeprecatedContentOptionsWarningsArePrinted() { var projectDirectory = TestAssets .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedContent") .CreateInstance() .WithSourceFiles() .Root; var cmd = new MigrateTestCommand() .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput(); cmd.Should().Pass(); cmd.StdOut.Should() .Contain( "The 'content' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); cmd.StdOut.Should() .Contain( "The 'contentExclude' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); cmd.StdOut.Should() .Contain( "The 'contentFiles' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); cmd.StdOut.Should() .Contain( "The 'contentBuiltIn' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); }
public void WhenSolutionContainsACsprojFileItGetsMovedToBackup() { var projectDirectory = TestAssets .GetProjectJson("NonRestoredTestProjects", "PJAppWithSlnAndOneAlreadyMigratedCsproj") .CreateInstance() .WithSourceFiles() .WithEmptyGlobalJson() .Root; var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); var cmd = new MigrateTestCommand() .WithWorkingDirectory(projectDirectory) .Execute($"\"{solutionRelPath}\""); cmd.Should().Pass(); projectDirectory .GetDirectory("TestLibrary") .GetFile("TestLibrary.csproj") .Should() .Exist(); projectDirectory .GetDirectory("TestLibrary") .GetFile("TestLibrary.csproj.migration_in_place_backup") .Should() .NotExist(); projectDirectory .GetDirectory("backup", "TestLibrary") .GetFile("TestLibrary.csproj") .Should() .Exist(); }
public void WhenMigratingDeprecatedPackOptionsWarningsArePrinted() { var projectDirectory = TestAssets .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedPack") .CreateInstance() .WithSourceFiles() .Root; var cmd = new MigrateTestCommand() .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput(); cmd.Should().Pass(); cmd.StdOut.Should() .Contain( "The 'repository' option in the root is deprecated. Use it in 'packOptions' instead."); cmd.StdOut.Should() .Contain( "The 'projectUrl' option in the root is deprecated. Use it in 'packOptions' instead."); cmd.StdOut.Should() .Contain( "The 'licenseUrl' option in the root is deprecated. Use it in 'packOptions' instead."); cmd.StdOut.Should() .Contain( "The 'iconUrl' option in the root is deprecated. Use it in 'packOptions' instead."); cmd.StdOut.Should() .Contain( "The 'owners' option in the root is deprecated. Use it in 'packOptions' instead."); cmd.StdOut.Should() .Contain( "The 'tags' option in the root is deprecated. Use it in 'packOptions' instead."); cmd.StdOut.Should() .Contain( "The 'releaseNotes' option in the root is deprecated. Use it in 'packOptions' instead."); cmd.StdOut.Should() .Contain( "The 'requireLicenseAcceptance' option in the root is deprecated. Use it in 'packOptions' instead."); cmd.StdOut.Should() .Contain( "The 'summary' option in the root is deprecated. Use it in 'packOptions' instead."); cmd.StdOut.Should() .Contain( "The 'packInclude' option is deprecated. Use 'files' in 'packOptions' instead."); }
public void WhenMigratingDeprecatedResourceExcludeOptionsWarningsArePrinted() { var projectDirectory = TestAssets .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedResourceExclude") .CreateInstance() .WithSourceFiles() .Root; var cmd = new MigrateTestCommand() .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput(); cmd.Should().Pass(); cmd.StdOut.Should() .Contain( "The 'resourceExclude' option is deprecated. Use 'embed' in 'buildOptions' instead."); }
public void WhenSolutionContainsACsprojFileItDoesNotTryToAddItAgain() { var projectDirectory = TestAssets .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithSlnAndOneAlreadyMigratedCsproj") .CreateInstance() .WithSourceFiles() .WithEmptyGlobalJson() .Root; var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); var cmd = new MigrateTestCommand() .WithWorkingDirectory(projectDirectory) .Execute($"\"{solutionRelPath}\""); cmd.Should().Pass(); cmd.StdOut.Should().NotContain("already contains project"); cmd.StdErr.Should().BeEmpty(); }