public void Should_Append_Binary_Logging_If_Enabled(string fileName, MSBuildBinaryLoggerImports imports, string args) { // Given var fixture = new DotNetCoreMSBuildBuilderFixture(); fixture.Settings.EnableBinaryLogger(fileName, imports); // When var result = fixture.Run(); // Then Assert.Equal(args, result.Args); }
/// <summary> /// Enables the binary logger with the specified log file name and imports. /// </summary> /// <param name="settings">The settings.</param> /// <param name="fileName">The log file name.</param> /// <param name="imports">The imports.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings EnableBinaryLogger(this DotNetMSBuildSettings settings, string fileName, MSBuildBinaryLoggerImports imports) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } settings.BinaryLogger = new MSBuildBinaryLoggerSettings { Enabled = true, FileName = fileName, Imports = imports, }; return(settings); }
public void Should_Append_Binary_Logging_If_Specified(bool enabled, string fileName, MSBuildBinaryLoggerImports imports, string args) { // Given var fixture = new DotNetCoreMSBuildBuilderFixture(); fixture.Settings.BinaryLogger = new MSBuildBinaryLoggerSettings { Enabled = enabled, FileName = fileName, Imports = imports }; // When var result = fixture.Run(); // Then Assert.Equal(args, result.Args); }
/// <summary> /// Enables the binary logger with the specified log file name and imports. /// </summary> /// <param name="settings">The settings.</param> /// <param name="fileName">The log file name.</param> /// <param name="imports">The imports.</param> /// <returns>The same <see cref="DotNetCoreMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetCoreMSBuildSettings EnableBinaryLogger(this DotNetCoreMSBuildSettings settings, string fileName, MSBuildBinaryLoggerImports imports) { return((DotNetCoreMSBuildSettings)DotNet.MSBuild.DotNetMSBuildSettingsExtensions.EnableBinaryLogger(settings, fileName, imports)); }