示例#1
0
        public void XmlSerializeDeserialize_Empty_AreEqual()
        {
            var input = new CurrencySerializeObject()
            {
                Id   = 17,
                Obj  = Currency.Empty,
                Date = new DateTime(1970, 02, 14),
            };
            var exp = new CurrencySerializeObject()
            {
                Id   = 17,
                Obj  = Currency.Empty,
                Date = new DateTime(1970, 02, 14),
            };
            var act = SerializationTest.XmlSerializeDeserialize(input);

            Assert.AreEqual(exp.Id, act.Id, "Id");
            Assert.AreEqual(exp.Obj, act.Obj, "Obj");
            DateTimeAssert.AreEqual(exp.Date, act.Date, "Date");;
        }
示例#2
0
        public void DataContractSerializeDeserialize_CurrencySerializeObject_AreEqual()
        {
            var input = new CurrencySerializeObject()
            {
                Id   = 17,
                Obj  = CurrencyTest.TestStruct,
                Date = new DateTime(1970, 02, 14),
            };
            var exp = new CurrencySerializeObject()
            {
                Id   = 17,
                Obj  = CurrencyTest.TestStruct,
                Date = new DateTime(1970, 02, 14),
            };
            var act = SerializationTest.DataContractSerializeDeserialize(input);

            Assert.AreEqual(exp.Id, act.Id, "Id");
            Assert.AreEqual(exp.Obj, act.Obj, "Obj");
            DateTimeAssert.AreEqual(exp.Date, act.Date, "Date");;
        }
示例#3
0
 public void XmlSerializeDeserialize_Empty_AreEqual()
 {
     var input = new CurrencySerializeObject()
     {
         Id = 17,
         Obj = Currency.Empty,
         Date = new DateTime(1970, 02, 14),
     };
     var exp = new CurrencySerializeObject()
     {
         Id = 17,
         Obj = Currency.Empty,
         Date = new DateTime(1970, 02, 14),
     };
     var act = SerializationTest.XmlSerializeDeserialize(input);
     Assert.AreEqual(exp.Id, act.Id, "Id");
     Assert.AreEqual(exp.Obj, act.Obj, "Obj");
     DateTimeAssert.AreEqual(exp.Date, act.Date, "Date"); ;
 }
示例#4
0
 public void DataContractSerializeDeserialize_CurrencySerializeObject_AreEqual()
 {
     var input = new CurrencySerializeObject()
     {
         Id = 17,
         Obj = CurrencyTest.TestStruct,
         Date = new DateTime(1970, 02, 14),
     };
     var exp = new CurrencySerializeObject()
     {
         Id = 17,
         Obj = CurrencyTest.TestStruct,
         Date = new DateTime(1970, 02, 14),
     };
     var act = SerializationTest.DataContractSerializeDeserialize(input);
     Assert.AreEqual(exp.Id, act.Id, "Id");
     Assert.AreEqual(exp.Obj, act.Obj, "Obj");
     DateTimeAssert.AreEqual(exp.Date, act.Date, "Date"); ;
 }