Пример #1
0
        public void UserPurseInitializeShouldSuccess()
        {
            UserPurseDataSet users = new UserPurseDataSet();

            users.Initialize("user.xml");

            XmlDocument xdoc = new XmlDocument();

            xdoc.Load("user.xml");
            var userPurse = xdoc.ChildNodes[0].ChildNodes[0];

            Assert.IsNotNull(userPurse);
            Assert.IsNotNull(userPurse.ChildNodes);
            Assert.AreEqual(4, userPurse.ChildNodes.Count);
            Assert.AreEqual("1", userPurse.ChildNodes[0].Attributes["kind"].Value);
            Assert.AreEqual(10, Int32.Parse(userPurse.ChildNodes[0].Attributes["number"].Value));
            Assert.AreEqual("2", userPurse.ChildNodes[1].Attributes["kind"].Value);
            Assert.AreEqual(30, Int32.Parse(userPurse.ChildNodes[1].Attributes["number"].Value));
            Assert.AreEqual("5", userPurse.ChildNodes[2].Attributes["kind"].Value);
            Assert.AreEqual(20, Int32.Parse(userPurse.ChildNodes[2].Attributes["number"].Value));
            Assert.AreEqual("10", userPurse.ChildNodes[3].Attributes["kind"].Value);
            Assert.AreEqual(15, Int32.Parse(userPurse.ChildNodes[3].Attributes["number"].Value));
        }
Пример #2
0
        public void UserPurseInitializeShouldSuccess()
        {
            UserPurseDataSet users = new UserPurseDataSet();
            users.Initialize("user.xml");

            XmlDocument xdoc = new XmlDocument();
            xdoc.Load("user.xml");
            var userPurse = xdoc.ChildNodes[0].ChildNodes[0];

            Assert.IsNotNull(userPurse);
            Assert.IsNotNull(userPurse.ChildNodes);
            Assert.AreEqual(4, userPurse.ChildNodes.Count);
            Assert.AreEqual("1", userPurse.ChildNodes[0].Attributes["kind"].Value);
            Assert.AreEqual(10, Int32.Parse(userPurse.ChildNodes[0].Attributes["number"].Value));
            Assert.AreEqual("2", userPurse.ChildNodes[1].Attributes["kind"].Value);
            Assert.AreEqual(30, Int32.Parse(userPurse.ChildNodes[1].Attributes["number"].Value));
            Assert.AreEqual("5", userPurse.ChildNodes[2].Attributes["kind"].Value);
            Assert.AreEqual(20, Int32.Parse(userPurse.ChildNodes[2].Attributes["number"].Value));
            Assert.AreEqual("10", userPurse.ChildNodes[3].Attributes["kind"].Value);
            Assert.AreEqual(15, Int32.Parse(userPurse.ChildNodes[3].Attributes["number"].Value));
        }