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

            var protocol  = new PocoDataContractSerialization();
            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);
        }
Esempio n. 2
0
 public void NullDataContract()
 {
     var protocol  = new PocoDataContractSerialization();
     var pubconfig = protocol.Encode <TestClass>(null);
 }