Ejemplo n.º 1
0
        public void ClearTest()
        {
            var document = new CsvDocument(new string[] { "name", "age" });

            document.Write("Light", 18);
            document.Write("Misa", 20);

            Assert.IsFalse(document.IsEmpty);
            Assert.AreEqual(2, document.Count);

            document.Clear();

            Assert.IsTrue(document.IsEmpty);
            Assert.AreEqual(0, document.Count);
        }
Ejemplo n.º 2
0
        public void ClearTest()
        {
            var document = new CsvDocument <Person>(new Person[]
            {
                new Person {
                    Name = "Akari", Age = 20
                },
                new Person {
                    Name = "Kyoko", Age = 21
                },
                new Person {
                    Name = "Yui", Age = 22
                },
                new Person {
                    Name = "Chinatsu", Age = 19
                }
            });

            Assert.AreEqual(4, document.Count);
            document.Clear();
            Assert.IsTrue(document.IsEmpty);
            Assert.AreEqual(0, document.Count);
        }