public void Test_TraktSearchFilterBuilder_GetParameters()
        {
            TraktShowStatus state1 = TraktShowStatus.ReturningSeries;
            TraktShowStatus state2 = TraktShowStatus.InProduction;

            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter
                                        .WithQuery("query")
                                        .WithYears(2016, 2018)
                                        .WithGenres("action", "drama")
                                        .WithLanguages("de", "en")
                                        .WithCountries("gb", "us")
                                        .WithRuntimes(30, 180)
                                        .WithRatings(60, 90)
                                        .WithCertifications("pg-13", "nr")
                                        .WithNetworks("abc", "fox")
                                        .WithStates(state1, state2)
                                        .Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(10);

            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "query", "query" },
                { "years", "2016-2018" },
                { "genres", "action,drama" },
                { "languages", "de,en" },
                { "countries", "gb,us" },
                { "runtimes", "30-180" },
                { "ratings", "60-90" },
                { "certifications", "pg-13,nr" },
                { "networks", "abc,fox" },
                { "status", $"{state1.UriName},{state2.UriName}" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_Years()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithYears(2016, 2018).Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "years", "2016-2018" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_Query()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithQuery("query").Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "query", "query" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_Certifications()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithCertifications("pg-13", "nr").Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "certifications", "pg-13,nr" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_Networks()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithNetworks("abc", "fox").Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "networks", "abc,fox" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_Runtimes()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithRuntimes(30, 180).Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "runtimes", "30-180" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_Ratings()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithRatings(60, 90).Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "ratings", "60-90" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_Countries()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithCountries("gb", "us").Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "countries", "gb,us" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_Languages()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithLanguages("de", "en").Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "languages", "de,en" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_Genres()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithGenres("action", "drama").Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "genres", "action,drama" }
            });
        }
        public void Test_TraktSearchFilterBuilder_GetParameters_With_States()
        {
            TraktShowStatus state1 = TraktShowStatus.ReturningSeries;
            TraktShowStatus state2 = TraktShowStatus.InProduction;

            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.WithStates(state1, state2).Build();

            filter.GetParameters().Should().NotBeNull().And.HaveCount(1);
            filter.GetParameters().Should().Contain(new Dictionary <string, object>()
            {
                { "status", $"{state1.UriName},{state2.UriName}" }
            });
        }
        public void Test_TraktSearchFilterBuilder_EmptyFilter()
        {
            ITraktSearchFilter filter = TraktFilterDirectory.SearchFilter.Build();

            filter.Query.Should().BeNull();
            filter.Year.Should().BeNull();
            filter.Years.Should().BeNull();
            filter.Genres.Should().BeNull();
            filter.Languages.Should().BeNull();
            filter.Countries.Should().BeNull();
            filter.Runtimes.Should().BeNull();
            filter.Ratings.Should().BeNull();
            filter.Certifications.Should().BeNull();
            filter.Networks.Should().BeNull();
            filter.States.Should().BeNull();
            filter.HasValues.Should().BeFalse();
            filter.ToString().Should().NotBeNull().And.BeEmpty();
            filter.GetParameters().Should().NotBeNull().And.BeEmpty();
        }
            private void SetupPathParamters()
            {
                var strResultTypes   = _resultTypes.UriName;
                var strExtendedInfo  = _extendedInfo.ToString();
                var filterParameters = _filter.GetParameters();
                var strSearchFields  = _searchFields.UriName;
                var strPage          = _page.ToString();
                var strLimit         = _limit.ToString();

                _data.Add(new object[] { _request1.GetUriPathParameters(), new Dictionary <string, object>
                                         {
                                             ["type"]  = strResultTypes,
                                             ["query"] = _query
                                         } });

                _data.Add(new object[] { _request2.GetUriPathParameters(), new Dictionary <string, object>
                                         {
                                             ["type"]     = strResultTypes,
                                             ["query"]    = _query,
                                             ["extended"] = strExtendedInfo
                                         } });

                _data.Add(new object[] { _request3.GetUriPathParameters(), new Dictionary <string, object>(filterParameters)
                                         {
                                             ["type"]  = strResultTypes,
                                             ["query"] = _query
                                         } });

                _data.Add(new object[] { _request4.GetUriPathParameters(), new Dictionary <string, object>
                                         {
                                             ["type"]   = strResultTypes,
                                             ["query"]  = _query,
                                             ["fields"] = strSearchFields
                                         } });

                _data.Add(new object[] { _request5.GetUriPathParameters(), new Dictionary <string, object>
                                         {
                                             ["type"]  = strResultTypes,
                                             ["query"] = _query,
                                             ["page"]  = strPage
                                         } });

                _data.Add(new object[] { _request6.GetUriPathParameters(), new Dictionary <string, object>
                                         {
                                             ["type"]  = strResultTypes,
                                             ["query"] = _query,
                                             ["limit"] = strLimit
                                         } });

                _data.Add(new object[] { _request7.GetUriPathParameters(), new Dictionary <string, object>(filterParameters)
                                         {
                                             ["type"]     = strResultTypes,
                                             ["query"]    = _query,
                                             ["extended"] = strExtendedInfo
                                         } });

                _data.Add(new object[] { _request8.GetUriPathParameters(), new Dictionary <string, object>(filterParameters)
                                         {
                                             ["type"]     = strResultTypes,
                                             ["query"]    = _query,
                                             ["extended"] = strExtendedInfo,
                                             ["fields"]   = strSearchFields
                                         } });

                _data.Add(new object[] { _request9.GetUriPathParameters(), new Dictionary <string, object>(filterParameters)
                                         {
                                             ["type"]     = strResultTypes,
                                             ["query"]    = _query,
                                             ["extended"] = strExtendedInfo,
                                             ["fields"]   = strSearchFields,
                                             ["page"]     = strPage
                                         } });

                _data.Add(new object[] { _request10.GetUriPathParameters(), new Dictionary <string, object>(filterParameters)
                                         {
                                             ["type"]     = strResultTypes,
                                             ["query"]    = _query,
                                             ["extended"] = strExtendedInfo,
                                             ["fields"]   = strSearchFields,
                                             ["page"]     = strPage,
                                             ["limit"]    = strLimit
                                         } });

                _data.Add(new object[] { _request11.GetUriPathParameters(), new Dictionary <string, object>(filterParameters)
                                         {
                                             ["type"]   = strResultTypes,
                                             ["query"]  = _query,
                                             ["fields"] = strSearchFields
                                         } });

                _data.Add(new object[] { _request12.GetUriPathParameters(), new Dictionary <string, object>(filterParameters)
                                         {
                                             ["type"]   = strResultTypes,
                                             ["query"]  = _query,
                                             ["fields"] = strSearchFields,
                                             ["page"]   = strPage
                                         } });

                _data.Add(new object[] { _request13.GetUriPathParameters(), new Dictionary <string, object>(filterParameters)
                                         {
                                             ["type"]   = strResultTypes,
                                             ["query"]  = _query,
                                             ["fields"] = strSearchFields,
                                             ["page"]   = strPage,
                                             ["limit"]  = strLimit
                                         } });

                _data.Add(new object[] { _request14.GetUriPathParameters(), new Dictionary <string, object>
                                         {
                                             ["type"]   = strResultTypes,
                                             ["query"]  = _query,
                                             ["fields"] = strSearchFields,
                                             ["page"]   = strPage
                                         } });

                _data.Add(new object[] { _request15.GetUriPathParameters(), new Dictionary <string, object>
                                         {
                                             ["type"]   = strResultTypes,
                                             ["query"]  = _query,
                                             ["fields"] = strSearchFields,
                                             ["page"]   = strPage,
                                             ["limit"]  = strLimit
                                         } });

                _data.Add(new object[] { _request16.GetUriPathParameters(), new Dictionary <string, object>
                                         {
                                             ["type"]  = strResultTypes,
                                             ["query"] = _query,
                                             ["page"]  = strPage,
                                             ["limit"] = strLimit
                                         } });
            }