Address PR comments

This commit is contained in:
Justin Goshi 2017-01-26 12:53:29 -08:00
parent 037da3fc01
commit 3821d39d6c
5 changed files with 88 additions and 31 deletions

View file

@ -39,6 +39,32 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
}
}
[Fact]
public void ItHasWarningWhenMigratingADeprecatedProjectJson()
{
var testProjectDirectory = TestAssets
.GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompileOptions")
.CreateInstance()
.WithSourceFiles()
.Root
.GetDirectory("project")
.FullName;
var mockProj = ProjectRootElement.Create();
var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(
testProjectDirectory,
testProjectDirectory,
mockProj);
var projectMigrator = new ProjectMigrator(new FakeEmptyMigrationRule());
var report = projectMigrator.Migrate(testSettings);
var projectReport = report.ProjectMigrationReports.First();
var warningMessage = projectReport.Warnings.First();
warningMessage.Should().Contain("MIGRATE1011::Deprecated Project:");
warningMessage.Should().Contain("The 'compile' option is deprecated. Use 'compile' in 'buildOptions' instead. (line: 3, file:");
}
[Fact]
public void ItHasErrorWhenMigratingADeprecatedNamedResourceOptionProjectJson()
{

View file

@ -72,12 +72,12 @@ namespace Microsoft.DotNet.Migration.Tests
new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.Execute("build")
.Execute("build -c Debug")
.Should().Pass();
new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.Execute("pack")
.Execute("pack -c Debug")
.Should().Pass();
var outputDir = projectDirectory.GetDirectory("bin", "Debug");
@ -212,12 +212,12 @@ namespace Microsoft.DotNet.Migration.Tests
new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.Execute("build")
.Execute("build -c Debug")
.Should().Pass();
new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.Execute("publish")
.Execute("publish -c Debug")
.Should().Pass();
var outputDir = projectDirectory.GetDirectory("bin", "Debug", "netcoreapp1.0");