Ejemplo n.º 1
0
        public void FlattenTest()
        {
            var     o         = new TestClass();
            var     flattener = new CommonXmlObjectFlattener();
            XmlNode flat      = flattener.Flatten(o, o.GetType());

            Assert.IsTrue(o.EqualsXml(flat));
        }
Ejemplo n.º 2
0
        public void LoadFromXmlTest()
        {
            var o         = new TestClass();
            var flattener = new CommonXmlObjectFlattener();

            XmlNode xml = flattener.Flatten(o, typeof(TestClass));

            PropertyLoader loader = new PropertyLoader();
            var            test   = loader.LoadFromXml <TestClass>(xml);

            Assert.IsTrue(o.Equals(test));
        }
        public void SetProperties <T>(T o) where T : class
        {
            CommonXmlObjectFlattener flattener = new CommonXmlObjectFlattener();

            flattener.Flatten(o, typeof(T));
        }