public void JsonSettingTest()
        {
            var weixinData = new WeixinData()
            {
                Id       = 1,
                UserName = "******",
                Note     = null,
                Sign     = null,
                Sex      = Sex.男
            };

            SerializerHelper js = new SerializerHelper();
            //string json = js.GetJsonString(weixinData);
            //Console.WriteLine(json);

            //JsonSetting jsonSetting = new JsonSetting(true);
            //string json2 = js.GetJsonString(weixinData, jsonSetting);
            //Console.WriteLine(json2);

            JsonSetting jsonSetting3 = new JsonSetting(true, new List <string>()
            {
                "Note"
            });
            string json3 = js.GetJsonString(weixinData, jsonSetting3);

            Console.WriteLine(json3);
        }
Example #2
0
        public async Task SignJsapi()
        {
            WeixinData data = new WeixinData();

            data["jsapi_ticket"] = "sM4AOVdWfPE4DxkXGEs8VMCPGGVi4C3VM0P37wVUCFvkVAy_90u5h9nbSlYy3-Sl-HhTdfl2fzFy1AOcHKP7qg";
            data["noncestr"]     = "Wm3WZYTPz0wzccnW";
            data["timestamp"]    = "1414587457";
            data["url"]          = "http://mp.weixin.qq.com?params=value";
            Assert.AreEqual("0f9de62fce790f9a083d5c99e95740ceb90c27ed", data.SignJsapi());
        }