public void CouldSerializeNumberPropertyAsString() {
     var t = new TypeWithNumberSerializedAsString();
     t.NormalInt = 123;
     t.AsString = 456;
     var j = t.ToJson();
     Console.WriteLine(j);
     var t2 = j.FromJson<TypeWithNumberDeSerializedAsString>();
     Assert.AreEqual("456", t2.AsString);
     var t1 = j.FromJson<TypeWithNumberSerializedAsString>();
     Assert.AreEqual(456, t1.AsString);
 }
Beispiel #2
0
        public void CouldSerializeNumberPropertyAsString()
        {
            var t = new TypeWithNumberSerializedAsString();

            t.NormalInt = 123;
            t.AsString  = 456;
            var j = t.ToJson();

            Console.WriteLine(j);
            var t2 = j.FromJson <TypeWithNumberDeSerializedAsString>();

            Assert.AreEqual("456", t2.AsString);
            var t1 = j.FromJson <TypeWithNumberSerializedAsString>();

            Assert.AreEqual(456, t1.AsString);
        }