public void ZendeskNotification_Roundtrips() { // Arrange JObject data = EmbeddedResource.ReadAsJObject("Microsoft.AspNet.WebHooks.Messages.ZendeskPostMessage.json"); ZendeskNotification expected = new ZendeskNotification { Body = "Agent replied something something", Title = "Agent replied", TicketId = "5" }; // Act ZendeskNotification actual = data["notification"].ToObject<ZendeskNotification>(); // Assert string expectedJson = JsonConvert.SerializeObject(expected); string actualJson = JsonConvert.SerializeObject(actual); Assert.Equal(expectedJson, actualJson); }
public void ZendeskNotification_Roundtrips() { // Arrange JObject data = EmbeddedResource.ReadAsJObject("Microsoft.AspNet.WebHooks.Messages.ZendeskPostMessage.json"); ZendeskNotification expected = new ZendeskNotification { Body = "Agent replied something something", Title = "Agent replied", TicketId = "5" }; // Act ZendeskNotification actual = data["notification"].ToObject <ZendeskNotification>(); // Assert string expectedJson = JsonConvert.SerializeObject(expected); string actualJson = JsonConvert.SerializeObject(actual); Assert.Equal(expectedJson, actualJson); }