Ejemplo n.º 1
0
        public void DontThrowErrorIfSplitEmptyLine(string input)
        {
            var splitter = new Rfc4180DataSplitter();
            var result   = splitter.SplitLines(input, "\r\n");

            result.Should().BeEmpty();
        }
Ejemplo n.º 2
0
        public void ThrowErrorIfNoEndQuoteFoundWhenExtractingLines(string delimiter, string input)
        {
            var    splitter = new Rfc4180DataSplitter();
            Action action   = () => splitter.SplitLines(input, delimiter);

            action.Should().Throw <MissingQuoteException>();
        }
Ejemplo n.º 3
0
        public void ReplaceAllNewLIneWithinDoubleQuotes(string delimiter, string input, string expected1, string expected2, string expected3)
        {
            var splitter = new Rfc4180DataSplitter();
            var result   = splitter.SplitLines(input, delimiter);

            result.Should().HaveCount(3);
            result[0].Should().Be(expected1);
            result[1].Should().Be(expected2);
            result[2].Should().Be(expected3);
        }