Exemplo n.º 1
0
        public void This_ParsesBodyCorrectly_WhenMultipleHeadersHaveNoText()
        {
            var rawBody = TestBodies.MultipleHeadersWithoutAssociatedText;

            var body = new JournalEntryBody(rawBody);

            body.Count().Should().Be(4);
            body.First().text.Should().BeEmpty();
            body.Take(2).Skip(1).Take(1).Should().OnlyContain(x => x.text == string.Empty && !string.IsNullOrWhiteSpace(x.header));
            body.Skip(2).Take(1).Should().OnlyContain(x => !string.IsNullOrWhiteSpace(x.header) && !string.IsNullOrWhiteSpace(x.text));
            var output = body.ToString();

            output.Should().Be(rawBody.Trim());
        }