public void DeserializesEmptyObjectCorrectly()
        {
            var json = "{}";
            var obj = new DataContractPublicFields();

            var result = (DataContractPublicFields)SimpleJson.DeserializeObject(json, typeof(DataContractPublicFields), SimpleJson.PocoJsonSerializerStrategy);

            Assert.IsNotNull(result);

            Assert.AreEqual(obj.NoDataMember, result.NoDataMember);
            Assert.AreEqual(obj.IgnoreDataMember, result.IgnoreDataMember);
            Assert.AreEqual(obj.DatMemberWithName, result.DatMemberWithName);
            Assert.AreEqual(obj.DataMemberWithoutName, result.DataMemberWithoutName);
        }
 public PublicFieldsSerializeTests()
 {
     _dataContractPublicFields = new DataContractPublicFields();
 }
Exemplo n.º 3
0
 public PublicFieldsSerializeTests()
 {
     _dataContractPublicFields = new DataContractPublicFields();
 }