public void testBadge_plus_2() { IosNotification ios = new IosNotification().incrBadge(2); JObject json = new JObject(); json.Add("sound", JToken.FromObject("")); json.Add("badge", JToken.FromObject("+2")); Assert.AreEqual(json.ToString(Formatting.None), JsonConvert.SerializeObject(ios, jSetting)); }
public void testQuickAlert() { IosNotification ios =new IosNotification().setAlert("aaa"); JObject json = new JObject(); json.Add("sound", JToken.FromObject("")); json.Add("badge", JToken.FromObject("+1")); json.Add("alert", JToken.FromObject("aaa")); Assert.AreEqual(json.ToString(Formatting.None), JsonConvert.SerializeObject(ios, jSetting)); }
public void testExtra() { IosNotification ios = new IosNotification().AddExtra("key", "value").AddExtra("key2", true); JObject json = new JObject(); JObject extra = new JObject(); extra.Add("key", JToken.FromObject("value")); extra.Add("key2", JToken.FromObject(true)); json.Add("sound", JToken.FromObject("")); json.Add("badge", JToken.FromObject("+1")); json.Add("extras", extra); Assert.AreEqual(json.ToString(Formatting.None), JsonConvert.SerializeObject(ios, jSetting)); }