Exemple #1
0
        private void Validate(TraktSearchIdLookupType searchIdLookupType, string lookupId)
        {
            if (searchIdLookupType == null)
            {
                throw new ArgumentNullException(nameof(searchIdLookupType), "search id lookup type must not be null");
            }

            if (searchIdLookupType == TraktSearchIdLookupType.Unspecified)
            {
                throw new ArgumentException("search id lookup type not valid", nameof(searchIdLookupType));
            }

            if (string.IsNullOrEmpty(lookupId) || lookupId.ContainsSpace())
            {
                throw new ArgumentException("search lookup id not valid", nameof(lookupId));
            }
        }
        public void TestTraktSearchIdLookupTypeIsTraktEnumeration()
        {
            var enumeration = new TraktSearchIdLookupType();

            enumeration.Should().BeAssignableTo <TraktEnumeration>();
        }
Exemple #3
0
        public async Task <TraktPaginationListResult <TraktSearchResult> > GetIdLookupResultsAsync(TraktSearchIdLookupType searchIdLookupType, [NotNull] string lookupId,
                                                                                                   int?page = null, int?limitPerPage = null)
        {
            Validate(searchIdLookupType, lookupId);

            return(await QueryAsync(new TraktSearchOldIdLookupRequest(Client)
            {
                Type = searchIdLookupType,
                LookupId = lookupId,
                PaginationOptions = new TraktPaginationOptions(page, limitPerPage)
            }));
        }