diff --git a/src/Cake.7zip.Tests/Fixtures/Outputs.cs b/src/Cake.7zip.Tests/Fixtures/Outputs.cs index bf26ed8e..d6469f9f 100644 --- a/src/Cake.7zip.Tests/Fixtures/Outputs.cs +++ b/src/Cake.7zip.Tests/Fixtures/Outputs.cs @@ -101,7 +101,7 @@ 0 20 201 SHA1 0 32 A SHA256 0 8 4 CRC64 0 32 202 BLAKE2sp"; - return demoOutput.Split(new[] { Environment.NewLine }, StringSplitOptions.None); + return demoOutput.ToArrayOfLines(); } } } diff --git a/src/Cake.7zip.Tests/Parsers/InformationOutputParserTests.cs b/src/Cake.7zip.Tests/Parsers/InformationOutputParserTests.cs index dc299e5c..4e893940 100644 --- a/src/Cake.7zip.Tests/Parsers/InformationOutputParserTests.cs +++ b/src/Cake.7zip.Tests/Parsers/InformationOutputParserTests.cs @@ -58,7 +58,7 @@ 0 D 40302 Rar2 0 D 40303 Rar3 0 D 40305 Rar5 0 ED 6F10701 7zAES - 0 ED 6F00181 AES256CBC".Split(new[] { Environment.NewLine }, StringSplitOptions.None); + 0 ED 6F00181 AES256CBC".ToArrayOfLines(); Assert.Equal(expected.Length, actual.Count); foreach (var codec in expected) @@ -93,8 +93,7 @@ public void InformationParser_parses_Hashers() 0 20 201 SHA1 0 32 A SHA256 0 8 4 CRC64 - 0 32 202 BLAKE2sp".Split(new[] { Environment.NewLine }, StringSplitOptions.None); - + 0 32 202 BLAKE2sp".ToArrayOfLines(); Assert.Equal(expected.Length, actual.Count); foreach (var hasher in expected) { @@ -163,7 +162,7 @@ 0 F Rar5 rar r00 R a r ! 1A 07 01 00 0 O Udf udf iso img offset=32768 01 C D 0 0 1 0 C SN LH wim wim swm esd ppkg M S W I M 00 00 00 0 C FMG zip zip z01 zipx jar xpi odt ods docx xlsx epub ipa apk appx P K 03 04 || P K 05 06 || P K 06 06 || P K 07 08 P K || P K 0 0 P K" - .Split(new[] { Environment.NewLine }, StringSplitOptions.None); + .ToArrayOfLines(); Assert.Equal(expected.Length, actual.Count); foreach (var format in expected) diff --git a/src/Cake.7zip.Tests/TestExtensions.cs b/src/Cake.7zip.Tests/TestExtensions.cs new file mode 100644 index 00000000..2c69075d --- /dev/null +++ b/src/Cake.7zip.Tests/TestExtensions.cs @@ -0,0 +1,13 @@ +namespace Cake.SevenZip.Tests +{ + using System; + using System.Linq; + + internal static class TestExtensions + { + internal static string[] ToArrayOfLines(this string @this) + { + return @this.Split(new[] { "\n" }, StringSplitOptions.None).Select(x => x.TrimEnd('\r')).ToArray(); + } + } +} diff --git a/src/Cake.7zip/Builder/ISupportOutputBuilder.cs b/src/Cake.7zip/Builder/ISupportOutputBuilder.cs index 4303c1c8..dcb51d8e 100644 --- a/src/Cake.7zip/Builder/ISupportOutputBuilder.cs +++ b/src/Cake.7zip/Builder/ISupportOutputBuilder.cs @@ -36,10 +36,16 @@ public abstract class BaseOutputBuilder : ISupportO where TCommand : OutputCommand { /// - public Action OutputAction { set { OutputCommand.OutputAction = value; } } + public Action OutputAction + { + set { OutputCommand.OutputAction = value; } + } /// - public Action RawOutputAction { set { OutputCommand.RawOutputAction = value; } } + public Action RawOutputAction + { + set { OutputCommand.RawOutputAction = value; } + } /// /// Gets the output command. diff --git a/src/Cake.7zip/Parsers/IInformationOutput.cs b/src/Cake.7zip/Parsers/IInformationOutput.cs index f559f77b..68629ffa 100644 --- a/src/Cake.7zip/Parsers/IInformationOutput.cs +++ b/src/Cake.7zip/Parsers/IInformationOutput.cs @@ -1,9 +1,9 @@ -namespace Cake.SevenZip +namespace Cake.SevenZip { using System.Collections.Generic; /// - /// The parsed Output of the + /// The parsed Output of the . /// public interface IInformationOutput { diff --git a/src/Cake.7zip/SevenZipRunner.cs b/src/Cake.7zip/SevenZipRunner.cs index 826efd36..825ced96 100644 --- a/src/Cake.7zip/SevenZipRunner.cs +++ b/src/Cake.7zip/SevenZipRunner.cs @@ -19,7 +19,6 @@ public sealed class SevenZipRunner : Tool private readonly ICakeEnvironment cakeEnvironment; private readonly IRegistry registry; private readonly IFileSystem fileSystem; - private readonly IProcessRunner processRunner; /// /// Initializes a new instance of the class. @@ -43,7 +42,6 @@ public SevenZipRunner( cakeEnvironment = environment; this.registry = registry; this.fileSystem = fileSystem; - this.processRunner = processRunner; } ///