コード例 #1
0
        public void DataContractSerializeDeserialize_CountrySerializeObject_AreEqual()
        {
            var input = new CountrySerializeObject
            {
                Id   = 17,
                Obj  = CountryTest.TestStruct,
                Date = new DateTime(1970, 02, 14),
            };
            var exp = new CountrySerializeObject
            {
                Id   = 17,
                Obj  = CountryTest.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 XmlSerializeDeserialize_Empty_AreEqual()
        {
            var input = new CountrySerializeObject
            {
                Id   = 17,
                Obj  = Country.Empty,
                Date = new DateTime(1970, 02, 14),
            };
            var exp = new CountrySerializeObject
            {
                Id   = 17,
                Obj  = Country.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");
            Assert.AreEqual(exp.Date, act.Date, "Date");
        }
コード例 #3
0
ファイル: CountryTest.cs プロジェクト: Corniel/Qowaiv
 public void SerializeDeserialize_Empty_AreEqual()
 {
     var input = new CountrySerializeObject()
     {
         Id = 17,
         Obj = CountryTest.TestStruct,
         Date = new DateTime(1970, 02, 14),
     };
     var exp = new CountrySerializeObject()
     {
         Id = 17,
         Obj = CountryTest.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");;
 }