Example #1
0
        public void XmlSerializeDeserialize_MinValue_AreEqual()
        {
            var input = new LocalDateTimeSerializeObject
            {
                Id   = 17,
                Obj  = LocalDateTime.MinValue,
                Date = new DateTime(1970, 02, 14),
            };
            var exp = new LocalDateTimeSerializeObject
            {
                Id   = 17,
                Obj  = LocalDateTime.MinValue,
                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");
            Assert.AreEqual(exp.Date, act.Date, "Date");
        }
Example #2
0
        public void DataContractSerializeDeserialize_LocalDateTimeSerializeObject_AreEqual()
        {
            var input = new LocalDateTimeSerializeObject
            {
                Id   = 17,
                Obj  = LocalDateTimeTest.TestStructNoMilliseconds,
                Date = new DateTime(1970, 02, 14),
            };
            var exp = new LocalDateTimeSerializeObject
            {
                Id   = 17,
                Obj  = LocalDateTimeTest.TestStructNoMilliseconds,
                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");
            Assert.AreEqual(exp.Date, act.Date, "Date");
        }
Example #3
0
        public void SerializeDeserialize_LocalDateTimeSerializeObject_AreEqual()
        {
            var input = new LocalDateTimeSerializeObject()
            {
                Id   = 17,
                Obj  = LocalDateTimeTest.TestStruct,
                Date = new DateTime(1970, 02, 14),
            };
            var exp = new LocalDateTimeSerializeObject()
            {
                Id   = 17,
                Obj  = LocalDateTimeTest.TestStruct,
                Date = new DateTime(1970, 02, 14),
            };
            var act = SerializationTest.SerializeDeserialize(input);

            Assert.AreEqual(exp.Id, act.Id, "Id");
            Assert.AreEqual(exp.Obj, act.Obj, "Obj");
            DateTimeAssert.AreEqual(exp.Date, act.Date, "Date");;;
        }
Example #4
0
 public void XmlSerializeDeserialize_MinValue_AreEqual()
 {
     var input = new  LocalDateTimeSerializeObject()
     {
         Id = 17,
         Obj = LocalDateTime.MinValue,
         Date = new DateTime(1970, 02, 14),
     };
     var exp = new LocalDateTimeSerializeObject()
     {
         Id = 17,
         Obj = LocalDateTime.MinValue,
         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");;
 }
Example #5
0
 public void DataContractSerializeDeserialize_LocalDateTimeSerializeObject_AreEqual()
 {
     var input = new LocalDateTimeSerializeObject()
     {
         Id = 17,
         Obj = LocalDateTimeTest.TestStructNoMilliseconds,
         Date = new DateTime(1970, 02, 14),
     };
     var exp = new LocalDateTimeSerializeObject()
     {
         Id = 17,
         Obj = LocalDateTimeTest.TestStructNoMilliseconds,
         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");;
 }