Exemplo n.º 1
0
        public void Tab_delimited()
        {
            var result = new DelimitedParser("\t").Parse("123\t4,567");

            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Length);
            Assert.AreEqual("123", result[0]);
            Assert.AreEqual("4,567", result[1]);
        }
Exemplo n.º 2
0
        public void Comma_delimited()
        {
            var result = new DelimitedParser(",").Parse("123,456");

            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Length);
            Assert.AreEqual("123", result[0]);
            Assert.AreEqual("456", result[1]);
        }
Exemplo n.º 3
0
        public void Multiple_comma_delimited()
        {
            var result = new DelimitedParser(",").Parse("123,456", "abc");

            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.Length);
            Assert.AreEqual("123", result[0]);
            Assert.AreEqual("456", result[1]);
            Assert.AreEqual("abc", result[2]);
        }
Exemplo n.º 4
0
        public void Comma_tab_delimited()
        {
            var result = new DelimitedParser(",", "\t").Parse("123,456\t789");

            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.Length);
            Assert.AreEqual("123", result[0]);
            Assert.AreEqual("456", result[1]);
            Assert.AreEqual("789", result[2]);
        }
Exemplo n.º 5
0
        public void Delimited_with_whitespace()
        {
            var result = new DelimitedParser(",").Parse(" 123 ,\n 456 ", " \tabc, def");

            Assert.IsNotNull(result);
            Assert.AreEqual(4, result.Length);
            Assert.AreEqual("123", result[0]);
            Assert.AreEqual("456", result[1]);
            Assert.AreEqual("abc", result[2]);
            Assert.AreEqual("def", result[3]);
        }