public void JsonPayload_TakesOverSerialization() { // Arrange GooglePushMessage gcmNot = new GooglePushMessage() { JsonPayload = "text" }; // Act string actual = gcmNot.ToString(); // Assert Assert.Equal("text", actual); }
public void Serializes_Demo() { // Arrange GooglePushMessage gcmNot = new GooglePushMessage(); gcmNot.CollapseKey = "demo"; gcmNot.DelayWhileIdle = true; gcmNot.Data.Add("key1", "value1"); gcmNot.Data.Add("key2", "value2"); gcmNot.TimeToLiveInSeconds = 3; // Act string actual = gcmNot.ToString(); // Assert Assert.Equal(Templates["Demo"], actual); }
public void GooglePushMessage_DataTimeToLive_SetsDataAndTimeToLive(IDictionary <string, string> data, TimeSpan?timeToLive) { // Act GooglePushMessage gcmNot = new GooglePushMessage(data, timeToLive); // Assert foreach (string dataKey in data.Keys) { Assert.Equal(data[dataKey], gcmNot.Data[dataKey]); } if (timeToLive != null) { Assert.Equal(timeToLive.Value.TotalSeconds, gcmNot.TimeToLiveInSeconds.Value); } else { Assert.Null(gcmNot.TimeToLiveInSeconds); } }