Exemplo n.º 1
0
        public void TestRead01()
        {
            var row = 0;

            using (var r = new TextCsvReader(new StringReader(sampleSimple01), new TextCsvSettings()
            {
            }))
            {
                while (r.ReadRow())
                {
                    Assert.AreEqual(r.Count, 2);
                    Console.WriteLine("{0}, {1}", r[0], r[1]);
                    row++;
                }
                Assert.AreEqual(2, row);
            }
        }
Exemplo n.º 2
0
        public void TestRead04()
        {
            const string sampleRead04 = "1;<p style=\"\"margin-top: 0\"\">Applikationszange    </p>;3";

            var row = 0;

            using (var r = new TextCsvReader(new StringReader(sampleRead04), new TextCsvSettings()
            {
            }))
            {
                while (r.ReadRow())
                {
                    Assert.AreEqual(r.Count, 3);
                    Assert.AreEqual(r[0], "1");
                    Assert.AreEqual(r[1], "<p style=\"margin-top: 0\">Applikationszange    </p>");
                    Assert.AreEqual(r[2], "3");
                    Console.WriteLine(r[1]);
                    row++;
                }
                Assert.AreEqual(1, row);
            }
        }