Describes one or more event notifications received as a Pusher WebHook. For details about Pusher WebHooks, see https://pusher.com/docs/webhooks.
 public PusherNotificationsTests()
 {
     _notifications = new PusherNotifications { CreatedAt = 34359738368 };
     _notifications.Events.Add(new Dictionary<string, object> { { "k1", "v1" } });
     _notifications.Events.Add(new Dictionary<string, object> { { "k2", "v2" } });
     _notifications.Events.Add(new Dictionary<string, object> { { "k3", "v3" } });
 }
Beispiel #2
0
        public void Serialization_Roundtrips()
        {
            // Act
            string ser = JsonConvert.SerializeObject(_notifications, _settings);
            PusherNotifications actual = JsonConvert.DeserializeObject <PusherNotifications>(ser, _settings);

            // Assert
            Assert.Equal(34359738368, actual.CreatedAt);
            Assert.Equal(3, actual.Events.Count);
            Assert.Equal("v1", actual.Events.ElementAt(0)["k1"]);
            Assert.Equal("v2", actual.Events.ElementAt(1)["k2"]);
            Assert.Equal("v3", actual.Events.ElementAt(2)["k3"]);
        }
Beispiel #3
0
 public PusherNotificationsTests()
 {
     _notifications = new PusherNotifications {
         CreatedAt = 34359738368
     };
     _notifications.Events.Add(new Dictionary <string, object> {
         { "k1", "v1" }
     });
     _notifications.Events.Add(new Dictionary <string, object> {
         { "k2", "v2" }
     });
     _notifications.Events.Add(new Dictionary <string, object> {
         { "k3", "v3" }
     });
 }