Exemplo n.º 1
0
        public async Task Test_SyncSeasonsLastActivitiesObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_3()
        {
            var traktJsonReader = new SyncSeasonsLastActivitiesObjectJsonReader();

            using (var reader = new StringReader(JSON_NOT_VALID_3))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var seasonsLastActivities = await traktJsonReader.ReadObjectAsync(jsonReader);

                    seasonsLastActivities.Should().NotBeNull();
                    seasonsLastActivities.RatedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.305Z").ToUniversalTime());
                    seasonsLastActivities.WatchlistedAt.Should().Be(DateTime.Parse("2014-11-19T22:02:41.308Z").ToUniversalTime());
                    seasonsLastActivities.CommentedAt.Should().BeNull();
                    seasonsLastActivities.HiddenAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.325Z").ToUniversalTime());
                }
        }
Exemplo n.º 2
0
        public async Task Test_SyncSeasonsLastActivitiesObjectJsonReader_ReadObject_From_JsonReader_Incomplete_8()
        {
            var traktJsonReader = new SyncSeasonsLastActivitiesObjectJsonReader();

            using (var reader = new StringReader(JSON_INCOMPLETE_8))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var seasonsLastActivities = await traktJsonReader.ReadObjectAsync(jsonReader);

                    seasonsLastActivities.Should().NotBeNull();
                    seasonsLastActivities.RatedAt.Should().BeNull();
                    seasonsLastActivities.WatchlistedAt.Should().BeNull();
                    seasonsLastActivities.CommentedAt.Should().BeNull();
                    seasonsLastActivities.HiddenAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.325Z").ToUniversalTime());
                }
        }
Exemplo n.º 3
0
 public async Task Test_SyncSeasonsLastActivitiesObjectJsonReader_ReadObject_From_Json_String_Null()
 {
     var jsonReader = new SyncSeasonsLastActivitiesObjectJsonReader();
     Func <Task <ITraktSyncSeasonsLastActivities> > seasonsLastActivities = () => jsonReader.ReadObjectAsync(default(string));
     await seasonsLastActivities.Should().ThrowAsync <ArgumentNullException>();
 }
        public void Test_SyncSeasonsLastActivitiesObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new SyncSeasonsLastActivitiesObjectJsonReader();
            Func <Task <ITraktSyncSeasonsLastActivities> > seasonsLastActivities = () => jsonReader.ReadObjectAsync(default(Stream));

            seasonsLastActivities.Should().Throw <ArgumentNullException>();
        }