public void testTitle() { AndroidNotification an = new AndroidNotification().setTitle("title"); JObject json = new JObject(); json.Add("title", JToken.FromObject("title")); Assert.AreEqual(json.ToString(Formatting.None), JsonConvert.SerializeObject(an, jSetting)); }
public void testNoParams() { AndroidNotification an = new AndroidNotification(); JObject jobject = new JObject(); var jsonString = JsonConvert.SerializeObject(an, jSetting); var jsonObject = jobject.ToString(Formatting.None); Assert.AreEqual(jsonString, jsonObject); }
public void testExtra() { AndroidNotification an = new AndroidNotification().AddExtra("key1", "value1").AddExtra("key2", 222); JObject json = new JObject(); JObject extra = new JObject(); extra.Add("key1", JToken.FromObject("value1")); extra.Add("key2", JToken.FromObject(222)); json.Add("extras", extra); Assert.AreEqual(json.ToString(Formatting.None), JsonConvert.SerializeObject(an, jSetting)); }
public static PushPayload PushObject_android_with_options() { PushPayload pushPayload = new PushPayload(); pushPayload.platform = Platform.android_ios(); var audience = Audience.all(); pushPayload.audience = audience; var notification = new Notification().setAlert("alert content"); AndroidNotification androidnotification = new AndroidNotification(); androidnotification.setAlert("Push Object android with options"); androidnotification.setBuilderID(3); androidnotification.setStyle(1); androidnotification.setBig_text("big text content"); androidnotification.setInbox("JSONObject"); androidnotification.setBig_pic_patht("picture url"); androidnotification.setPriority(0); androidnotification.setCategory("category str"); notification.AndroidNotification =androidnotification; notification.IosNotification = new IosNotification(); notification.IosNotification.incrBadge(1); notification.IosNotification.AddExtra("extra_key", "extra_value"); pushPayload.notification = notification.Check(); return pushPayload; }