ModelBuilder.UnitTests.DefaultBuildLogTests.WritingLogEntryIndentsAllLinesOfMessageTest C# (CSharp) Method

WritingLogEntryIndentsAllLinesOfMessageTest() private method

private WritingLogEntryIndentsAllLinesOfMessageTest ( ) : void
return void
        public void WritingLogEntryIndentsAllLinesOfMessageTest()
        {
            var target = new DefaultBuildLog();

            Exception exception;

            try
            {
                throw new TimeoutException();
            }
            catch (Exception ex)
            {
                // Get the exception with a valid stack trace
                exception = ex;
            }

            target.CreatingType(typeof(Person), null);
            target.BuildFailure(exception);
            target.CreatedType(typeof(Person), null);

            var lines = target.Output.Split(
                new[]
                {
                    Environment.NewLine
                },
                StringSplitOptions.RemoveEmptyEntries);
            var indentedLines = lines.Skip(1).Take(lines.Length - 2);

            indentedLines.All(x => x.StartsWith("    ")).Should().BeTrue();
        }
    }