public void Should_Set_Warning_Code_Behaviour(MSBuildTreatAllWarningsAs treatAllAs) { // Given var settings = new DotNetCoreMSBuildSettings(); // When settings.TreatAllWarningsAs(treatAllAs); // Then Assert.Equal(treatAllAs, settings.TreatAllWarningsAs); }
public void Should_Add_WarnAsMessage_Argument(MSBuildTreatAllWarningsAs treatAllWarningsAs, string[] errorCodes, string expectedValue) { // Given var fixture = new DotNetCoreMSBuildBuilderFixture(); fixture.Settings.TreatAllWarningsAs = treatAllWarningsAs; foreach (var errorCode in errorCodes) { fixture.Settings.WarningCodesAsMessage.Add(errorCode); } // When var result = fixture.Run(); // Then Assert.Equal($"msbuild /warnasmessage{expectedValue}", result.Args); }
/// <summary> /// Sets how all warnings should be treated. /// </summary> /// <param name="settings">The settings.</param> /// <param name="behaviour">How all warning should be treated.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings TreatAllWarningsAs(this DotNetMSBuildSettings settings, MSBuildTreatAllWarningsAs behaviour) { EnsureSettings(settings); settings.TreatAllWarningsAs = behaviour; return(settings); }
/// <summary> /// Sets how all warnings should be treated. /// </summary> /// <param name="settings">The settings.</param> /// <param name="behaviour">How all warning should be treated.</param> /// <returns>The same <see cref="DotNetCoreMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetCoreMSBuildSettings TreatAllWarningsAs(this DotNetCoreMSBuildSettings settings, MSBuildTreatAllWarningsAs behaviour) { return((DotNetCoreMSBuildSettings)DotNet.MSBuild.DotNetMSBuildSettingsExtensions.TreatAllWarningsAs(settings, behaviour)); }