Example #1
0
        public void PopulateRelationTest()
        {
            bool flag = false;

            tree.PopulateRelation();
            flag = true;
            Assert.AreEqual(true, flag);

            Assert.AreEqual(0, tree.Signs.Length);
            Assert.AreEqual(0, tree.Groups.Length);
        }
Example #2
0
        public void PopulateRelationTest1()
        {
            SignInfo      sign  = new SignInfo();
            SignGroupInfo group = new SignGroupInfo();

            group.Name = "group";

            sign.Name    = "sign";
            group.Parent = tree;
            sign.Parent  = group;
            //_tree.AddSign(sign);
            Serialiser <SignGroupTree> ser = Serialiser <SignGroupTree> .Binaray;

            using (MemoryStream stream = new MemoryStream())
            {
                ser.Serialize(tree, stream);

                tree.Clear();
                stream.Position = 0;
                tree            = ser.Deserialise(stream);
                stream.Close();
            }

            tree.PopulateRelation();
            //
            Assert.AreEqual(1, tree.Groups.Length);
            Assert.AreEqual(1, tree.Groups[0].Signs.Length);
            Assert.AreEqual(0, tree.Signs.Length);
        }