forked from Redth/PushSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Serialization of GcmNotification Priority
This fixes Redth#679 where the priority was being serialized as a number instead of the text as per Google's docs
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using NUnit.Framework; | ||
using PushSharp.Google; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace PushSharp.Tests | ||
{ | ||
[Category ("GCM")] | ||
[TestFixture] | ||
public class GcmTests | ||
{ | ||
[Test] | ||
public void GcmNotification_Priority_Should_Serialize_As_String_High () | ||
{ | ||
var n = new GcmNotification (); | ||
n.Priority = GcmNotificationPriority.High; | ||
|
||
var str = n.ToString (); | ||
|
||
Assert.IsTrue (str.Contains ("high")); | ||
} | ||
|
||
[Test] | ||
public void GcmNotification_Priority_Should_Serialize_As_String_Normal () | ||
{ | ||
var n = new GcmNotification (); | ||
n.Priority = GcmNotificationPriority.Normal; | ||
|
||
var str = n.ToString (); | ||
|
||
Assert.IsTrue (str.Contains ("normal")); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters