コード例 #1
0
 public void testQuickAlert()
 {
     WinphoneNotification winphone = new WinphoneNotification().setAlert("aaa");
     JObject json = new JObject();
     json.Add("alert", JToken.FromObject("aaa"));
     Assert.AreEqual(json.ToString(Formatting.None), JsonConvert.SerializeObject(winphone, jSetting));
 }
コード例 #2
0
        public void testEmpty()
        {
            WinphoneNotification winphone = new WinphoneNotification();
           
            JObject json = new JObject();

            Assert.AreEqual(new JObject().ToString(Formatting.None), JsonConvert.SerializeObject(winphone, jSetting));
        }
コード例 #3
0
 public void testExtra()
 {
     WinphoneNotification winphone = new WinphoneNotification().AddExtra("key", "value").AddExtra("key2", 222);
     JObject json = new JObject();
     JObject extra = new JObject();
     extra.Add("key", JToken.FromObject("value"));
     extra.Add("key2", JToken.FromObject(222));
     json.Add("extras", extra);
     Assert.AreEqual(json.ToString(Formatting.None), JsonConvert.SerializeObject(winphone, jSetting));
 }