示例#1
0
        public void DataContractSerializeDeserialize_EloSerializeObject_AreEqual()
        {
            var input = new EloSerializeObject
            {
                Id   = 17,
                Obj  = EloTest.TestStruct,
                Date = new DateTime(1970, 02, 14),
            };
            var exp = new EloSerializeObject
            {
                Id   = 17,
                Obj  = EloTest.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");
            Assert.AreEqual(exp.Date, act.Date, "Date");
        }
示例#2
0
        public void SerializeDeserialize_Zero_AreEqual()
        {
            var input = new EloSerializeObject
            {
                Id   = 17,
                Obj  = Elo.Zero,
                Date = new DateTime(1970, 02, 14),
            };
            var exp = new EloSerializeObject
            {
                Id   = 17,
                Obj  = Elo.Zero,
                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");
            Assert.AreEqual(exp.Date, act.Date, "Date");
        }
示例#3
0
文件: EloTest.cs 项目: Corniel/Qowaiv
 public void XmlSerializeDeserialize_EloSerializeObject_AreEqual()
 {
     var input = new EloSerializeObject()
     {
         Id = 17,
         Obj = EloTest.TestStruct,
         Date = new DateTime(1970, 02, 14),
     };
     var exp = new EloSerializeObject()
     {
         Id = 17,
         Obj = EloTest.TestStruct,
         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");;
 }