Ejemplo n.º 1
0
        public async Task Test_TraktSyncModule_GetPlaybackProgress_With_EndAtAt()
        {
            TraktClient client = TestUtility.GetOAuthMockClient(
                $"{GET_PLAYBACK_PROGRESS_URI}/{PLAYBACK_PROGRESS_TYPE.UriName}?end_at={PLAYBACK_PROGRESS_END_AT.ToTraktLongDateTimeString()}",
                PLAYBACK_PROGRESS_JSON, 1, 10, 1, PLAYBACK_PROGRESS_ITEM_COUNT);

            TraktPagedResponse <ITraktSyncPlaybackProgressItem> response = await client.Sync.GetPlaybackProgressAsync(PLAYBACK_PROGRESS_TYPE, null, PLAYBACK_PROGRESS_END_AT);

            response.Should().NotBeNull();
            response.IsSuccess.Should().BeTrue();
            response.HasValue.Should().BeTrue();
            response.Value.Should().NotBeNull().And.HaveCount(2);
            response.ItemCount.Should().HaveValue().And.Be(PLAYBACK_PROGRESS_ITEM_COUNT);
            response.Limit.Should().Be(10u);
            response.Page.Should().Be(1u);
            response.PageCount.Should().HaveValue().And.Be(1);
        }
Ejemplo n.º 2
0
        public async Task Test_TraktSyncModule_GetPlaybackProgress_Complete()
        {
            TraktClient client = TestUtility.GetOAuthMockClient(
                $"{GET_PLAYBACK_PROGRESS_URI}/{PLAYBACK_PROGRESS_TYPE.UriName}" +
                $"?start_at={PLAYBACK_PROGRESS_START_AT.ToTraktLongDateTimeString()}&end_at={PLAYBACK_PROGRESS_END_AT.ToTraktLongDateTimeString()}" +
                $"&page={PAGE}&limit={PLAYBACK_PROGRESS_LIMIT}",
                PLAYBACK_PROGRESS_JSON, 1, 10, 1, PLAYBACK_PROGRESS_ITEM_COUNT);

            var pagedParameters = new TraktPagedParameters(PAGE, PLAYBACK_PROGRESS_LIMIT);

            TraktPagedResponse <ITraktSyncPlaybackProgressItem> response =
                await client.Sync.GetPlaybackProgressAsync(PLAYBACK_PROGRESS_TYPE, PLAYBACK_PROGRESS_START_AT, PLAYBACK_PROGRESS_END_AT, pagedParameters);

            response.Should().NotBeNull();
            response.IsSuccess.Should().BeTrue();
            response.HasValue.Should().BeTrue();
            response.Value.Should().NotBeNull().And.HaveCount(2);
            response.ItemCount.Should().HaveValue().And.Be(PLAYBACK_PROGRESS_ITEM_COUNT);
            response.Limit.Should().Be(10u);
            response.Page.Should().Be(1u);
            response.PageCount.Should().HaveValue().And.Be(1);
        }