Exemplo n.º 1
0
        public void readRowFunc()
        {
            Func <IEnumerable <List <String> > > source = () => new[]
            {
                new List <String> {
                    "a", "1"
                },
                new List <String> {
                    "b", "2"
                },
                new List <String> {
                    "c", "3"
                }
            };

            String actual;

            using (Pnyx p = new Pnyx())
            {
                p.setSettings(outputNewline: "\n");
                p.readRowFunc(source);
                actual = p.processToString();
            }

            String expected = "a,1\nb,2\nc,3";

            Assert.Equal(expected, actual);

            using (Pnyx p = new Pnyx())
            {
                p.setSettings(outputNewline: "\n");
                p.readRowFunc(source, header: () => new List <string> {
                    "Letter", "Number"
                });
                actual = p.processToString();
            }

            expected = "Letter,Number\n" + expected;
            Assert.Equal(expected, actual);
        }