Example #1
0
        public void TestReadXmlDocument()
        {
            ListSerializable <User> usersList = new UserList();

            usersList.Add(new User("Toto", "Titi"));
            usersList.Add(new User("Tata", "Roro"));

            IWriter <User> writer = new XmlWriter <User>();

            writer.Write <UserList>(usersList, XmlFile);

            XDocument doc = new XmlReader <User>("users", "user").read(XmlFile);

            Assert.IsNotNull(doc);

            Assert.AreEqual(1, doc.Descendants("users").Count());
        }