private static void CheckOutput([NotNull] this IEnumerable <string> actualLines, [NotNull] IEnumerable <string> expectedLines)
        {
            if (actualLines == null)
            {
                throw new ArgumentNullException(nameof(actualLines));
            }
            if (expectedLines == null)
            {
                throw new ArgumentNullException(nameof(expectedLines));
            }
            // ReSharper disable once PossibleMultipleEnumeration
            var filteredActualLines = ServiceMessages.FilterTeamCityServiceMessages(actualLines).ToList();
            // ReSharper disable once PossibleMultipleEnumeration
            var curExpectedLines = ServiceMessages.FilterTeamCityServiceMessages(actualLines).ToList();

            filteredActualLines.Count.ShouldBe(curExpectedLines.Count);
            foreach (var pair in filteredActualLines.Zip(curExpectedLines, (actualLine, expectedLine) => new { actualLine, expectedLine }))
            {
                CheckLines(pair.actualLine, pair.expectedLine);
            }
        }
        public static void ResultShouldBe([NotNull] this CommandLineResult actualResult, [NotNull] CommandLineResult expectedResult, [CanBeNull] bool?producesTeamCityServiceMessages = null)
        {
            if (actualResult == null)
            {
                throw new ArgumentNullException(nameof(actualResult));
            }
            if (expectedResult == null)
            {
                throw new ArgumentNullException(nameof(expectedResult));
            }
            actualResult.ExitCode.ShouldBe(expectedResult.ExitCode);
            CheckOutput(actualResult.StdOut, expectedResult.StdOut);
            CheckOutput(actualResult.StdError, expectedResult.StdError);
            if (producesTeamCityServiceMessages.HasValue)
            {
                (ServiceMessages.GetNumberServiceMessage(actualResult.StdOut) > 0).ShouldBe(producesTeamCityServiceMessages.Value);
            }

            ServiceMessages.ResultShouldContainCorrectStructureAndSequence(actualResult.StdOut);
            ServiceMessages.ResultShouldContainCorrectStructureAndSequence(actualResult.StdError);
        }