コード例 #1
0
        public void CallSiteSerialization_DefaultArgIndexIsNotSerialized()
        {
            var obj = new CallSite
            {
                kind   = CallSiteKind.RECEIVER,
                method = Names.Method("[R,P] [T,P].M()").ToCoReName()
            };

            var json = "{" + Environment.NewLine +
                       "    \"kind\": \"RECEIVER\"," + Environment.NewLine +
                       "    \"method\": \"LT.M()LR;\"" + Environment.NewLine +
                       "}";

            var actualJson = obj.ToFormattedJson();

            Assert.AreEqual(json, actualJson);
            var other = json.ParseJsonTo <CallSite>();

            Assert.AreEqual(obj, other);
        }