dotnet migrate uses the correct TreatWarningsAsErrors property (#5492)
This commit is contained in:
parent
e8c5d23c29
commit
1c80899909
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue