Esempio n. 1
0
        public void should_split_when_all_lines_are_empty()
        {
            //ARRANGE
            var chunker    = new LineEndingsPreservingChunker();
            var sampleText = "\r\n\r\n\r\n";

            //ACT
            var chunks = chunker.Chunk(sampleText);

            //ASSERT
            Assert.Equal(3, chunks.Length);
            Assert.Equal("\r\n", chunks[0]);
            Assert.Equal("\r\n", chunks[1]);
            Assert.Equal("\r\n", chunks[2]);
        }
Esempio n. 2
0
        public void should_split_lines_when_last_does_not_end_with_lineending()
        {
            //ARRANGE
            var chunker    = new LineEndingsPreservingChunker();
            var sampleText = "First\r\nSecond\r\nLast";

            //ACT
            var chunks = chunker.Chunk(sampleText);

            //ASSERT
            Assert.Equal(3, chunks.Length);
            Assert.Equal("First\r\n", chunks[0]);
            Assert.Equal("Second\r\n", chunks[1]);
            Assert.Equal("Last", chunks[2]);
        }
Esempio n. 3
0
        public void should_split_lines_when_first_line_empty()
        {
            //ARRANGE
            var chunker    = new LineEndingsPreservingChunker();
            var sampleText = "\r\nFirst\r\nSecond\r\nLast\r\n";

            //ACT
            var chunks = chunker.Chunk(sampleText);

            //ASSERT
            Assert.Equal(4, chunks.Length);
            Assert.Equal("\r\n", chunks[0]);
            Assert.Equal("First\r\n", chunks[1]);
            Assert.Equal("Second\r\n", chunks[2]);
            Assert.Equal("Last\r\n", chunks[3]);
        }