dotnet migrate uses the correct TreatWarningsAsErrors property (#5492)

This commit is contained in:
Justin Goshi 2017-01-30 14:34:19 -10:00 committed by Piotr Puszkiewicz
parent e8c5d23c29
commit 1c80899909
2 changed files with 4 additions and 4 deletions

View file

@ -55,7 +55,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
compilerOptions => compilerOptions.PreserveCompilationContext != null && compilerOptions.PreserveCompilationContext.Value);
private AddPropertyTransform<CommonCompilerOptions> WarningsAsErrorsTransform =>
new AddPropertyTransform<CommonCompilerOptions>("WarningsAsErrors",
new AddPropertyTransform<CommonCompilerOptions>("TreatWarningsAsErrors",
compilerOptions => compilerOptions.WarningsAsErrors.ToString().ToLower(),
compilerOptions => compilerOptions.WarningsAsErrors != null && compilerOptions.WarningsAsErrors.Value);

View file

@ -193,8 +193,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
}
}");
mockProj.Properties.Count(p => p.Name == "WarningsAsErrors").Should().Be(1);
mockProj.Properties.First(p => p.Name == "WarningsAsErrors").Value.Should().Be("true");
mockProj.Properties.Count(p => p.Name == "TreatWarningsAsErrors").Should().Be(1);
mockProj.Properties.First(p => p.Name == "TreatWarningsAsErrors").Value.Should().Be("true");
mockProj = RunBuildOptionsRuleOnPj(@"
{
@ -203,7 +203,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
}
}");
mockProj.Properties.Count(p => p.Name == "WarningsAsErrors").Should().Be(0);
mockProj.Properties.Count(p => p.Name == "TreatWarningsAsErrors").Should().Be(0);
}
[Fact]