コード例 #1
0
        public void Backed_get_properties_can_be_deserialised()
        {
            var original = new GetOnlyWithBacking(123344044);
            var str1     = original.ToJson();
            var copy     = str1.FromJson <GetOnlyWithBacking>();

            Console.WriteLine(str1);

            // ReflectionExtensions.cs Line 417 is being used to determine *deserialisable*
            // for properties type based on if the property is *readable*, not *writable* -- by design

            //Rule: To be emitted properties should be readable, to be deserialized properties should be writeable

            Assert.That(copy.Property, Is.EqualTo(original.Property));
        }
コード例 #2
0
		public void Backed_get_properties_can_be_deserialised()
		{
			var original = new GetOnlyWithBacking(123344044);
			var str1 = original.ToJson();
			var copy = str1.FromJson<GetOnlyWithBacking>();

			Console.WriteLine(str1);

			// ReflectionExtensions.cs Line 417 is being used to determine *deserialisable*
			// for properties type based on if the property is *readable*, not *writable* -- by design

            //Rule: To be emitted properties should be readable, to be deserialized properties should be writeable

			Assert.That(copy.Property, Is.EqualTo(original.Property));
		}