Exemplo n.º 1
0
        public void Xml_Tests()
        {
            var initial = new TestClass {
                D = DateTime.Now, Ignored = 22, S = "string"
            };

            var protocol  = new PocoXmlSerialization();
            var pubconfig = protocol.Encode(initial);

            var props = new BasicProperties();

            props.Headers = new Dictionary <string, object>();
            props.Headers["AssemblyQualifiedName"] = initial.GetType().AssemblyQualifiedName;
            var decoded = protocol.Decode <TestClass>(pubconfig.Body, string.Empty, string.Empty, props);

            Assert.AreEqual(initial.D, decoded.D);
            Assert.AreEqual(initial.S, decoded.S);
            Assert.AreEqual(0, decoded.Ignored);
        }
Exemplo n.º 2
0
 public void NullXml()
 {
     var protocol  = new PocoXmlSerialization();
     var pubconfig = protocol.Encode <TestClass>(null);
 }