Converts Notifications to their appropriate type.
Наследование: Newtonsoft.Json.JsonConverter
        public void NotificationConverter_ReadJsonCommentNotification_Equal()
        {
            var converter = new NotificationConverter();
            var reader =
                new JsonTextReader(new StringReader(MockAccountEndpointResponses.GetCommentNotification));
            reader.Read();
            var serializer = new JsonSerializer();

            var actual =
                (CommentNotification) converter.ReadJson(reader, typeof(CommentNotification), null, serializer);
            Assert.NotNull(actual);

            Assert.Equal(null, actual.AlbumCover);
            Assert.Equal("jasdev", actual.Author);
            Assert.Equal(3698510, actual.AuthorId);
            Assert.Equal(0, actual.Children.Count());
            Assert.Equal("Reply test", actual.CommentText);
            Assert.Equal(new DateTimeOffset(new DateTime(2014, 07, 22, 23, 12, 54, DateTimeKind.Utc)),
                actual.DateTime);
            Assert.Equal(false, actual.Deleted);
            Assert.Equal(0, actual.Downs);
            Assert.Equal("VK9VqcM", actual.ImageId);
            Assert.Equal(false, actual.OnAlbum);
            Assert.Equal(3615, actual.ParentId);
            Assert.Equal(1, actual.Points);
            Assert.Equal(1, actual.Ups);
            Assert.Equal(3616, actual.Id);
        }
        public void NotificationConverter_ReadJsonMessageNotification_AreEqual()
        {
            var converter = new NotificationConverter();
            var reader =
                new JsonTextReader(new StringReader(AccountEndpointResponses.GetMessageNotification));
            reader.Read();
            var serializer = new JsonSerializer();

            var actual = (Message) converter.ReadJson(reader, typeof (Message), null, serializer);
            Assert.IsNotNull(actual);

            Assert.AreEqual(76767, actual.Id);
            Assert.AreEqual("Bob", actual.From);
            Assert.AreEqual(89898, actual.AccountId);
            Assert.AreEqual(3434, actual.WithAccountId);
            Assert.AreEqual("Test33", actual.LastMessage);
            Assert.AreEqual(2, actual.MessageNum);
            Assert.AreEqual(new DateTimeOffset(new DateTime(2015, 10, 12, 02, 31, 43, DateTimeKind.Utc)),
                actual.DateTime);
        }
        public void CanConvert(Type type, bool canConvert)
        {
            var converter = new NotificationConverter();

            Assert.Equal(converter.CanConvert(type), canConvert);
        }
 public void NotificationConverter_CanConvertMessage_IsTrue()
 {
     var converter = new NotificationConverter();
     var canConvert = converter.CanConvert(new Message().GetType());
     Assert.IsTrue(canConvert);
 }
 public void NotificationConverter_CanConvertComment_IsTrue()
 {
     var converter = new NotificationConverter();
     var canConvert = converter.CanConvert(new Comment().GetType());
     Assert.IsTrue(canConvert);
 }