public void AddAttr()
        {
            AttrContainer ac = new AttrContainer("AttrName", "AttrContainer");

            Attr <string> aString = new Attr <string>("StringAttribute", "value");
            Attr <int>    aInt    = new Attr <int>("IntAttribute", 123);

            ac.AddAttribute(aString);
            ac.AddAttribute(aInt);

            Assert.AreEqual("value", ((Attr <string>)ac.GetAttribute("StringAttribute")).Value);
            Assert.AreEqual(123, ((Attr <int>)ac.GetAttribute("IntAttribute")).Value);
        }
        public void ChangeValueAttr()
        {
            AttrContainer ac    = new AttrContainer("AttrName", "AttrContainer");
            Attr <string> aName = (Attr <string>)ac.GetAttribute("name");

            Assert.AreEqual("AttrName", ((Attr <string>)ac.GetAttribute("name")).Value);
            Assert.AreEqual("AttrName", aName.Value);

            aName.Value = "NewName";

            Assert.AreEqual("NewName", ((Attr <string>)ac.GetAttribute("name")).Value);
            Assert.AreEqual("NewName", aName.Value);
        }
        public void AttrContainerOfAttrContainer()
        {
            AttrContainer ac = new AttrContainer("root", "AttrContainer");

            AttrContainer acChild1 = new AttrContainer("Attrchild1", "AttrContainer");
            AttrContainer acChild2 = new AttrContainer("Attrchild2", "AttrContainer");

            ac.AddAttribute(new Attr <AttrContainer>("child1", acChild1));
            ac.AddAttribute(new Attr <AttrContainer>("child2", acChild2));

            Assert.AreEqual("child1", ((Attr <AttrContainer>)ac.GetAttribute("child1")).Name);
            Assert.AreEqual("child2", ((Attr <AttrContainer>)ac.GetAttribute("child2")).Name);

            Assert.AreEqual("Attrchild1", ((ac.GetAttribute("child1") as Attr <AttrContainer>).Value.GetAttribute("name") as Attr <string>).Value);
            Assert.AreEqual("Attrchild2", ((ac.GetAttribute("child2") as Attr <AttrContainer>).Value.GetAttribute("name") as Attr <string>).Value);
        }
        public void AttrContainerName()
        {
            AttrContainer ac    = new AttrContainer("AttrName", "AttrContainer");
            Attr <string> aName = (Attr <string>)ac.GetAttribute("name");

            Assert.AreEqual("AttrName", aName.Value);
        }
 public void KeyNotFound()
 {
     AttrContainer ac   = new AttrContainer("AttrName", "AttrContainer");
     Attr <int>    aInt = ac.GetAttribute("notFound") as Attr <int>;
 }