コード例 #1
0
        public void Test_TraktMovieFilterBuilder_ToString()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter
                                       .WithQuery("query")
                                       .WithYears(2016, 2018)
                                       .WithGenres("action", "drama")
                                       .WithLanguages("de", "en")
                                       .WithCountries("gb", "us")
                                       .WithRuntimes(30, 180)
                                       .WithRatings(60, 90)
                                       .WithCertifications("pg-13", "nr")
                                       .Build();

            filter.ToString().Should().Be("query=query&years=2016-2018&genres=action,drama&languages=de,en" +
                                          "&countries=gb,us&runtimes=30-180&ratings=60-90&certifications=pg-13,nr");
        }
コード例 #2
0
        public void Test_TraktMovieFilterBuilder_EmptyFilter()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.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.HasValues.Should().BeFalse();
            filter.ToString().Should().NotBeNull().And.BeEmpty();
            filter.GetParameters().Should().NotBeNull().And.BeEmpty();
        }
コード例 #3
0
        public void Test_TraktMovieFilterBuilder_ToString_With_Certifications()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.WithCertifications("pg-13", "nr").Build();

            filter.ToString().Should().Be("certifications=pg-13,nr");
        }
コード例 #4
0
        public void Test_TraktMovieFilterBuilder_ToString_With_Ratings()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.WithRatings(60, 90).Build();

            filter.ToString().Should().Be("ratings=60-90");
        }
コード例 #5
0
        public void Test_TraktMovieFilterBuilder_ToString_With_Runtimes()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.WithRuntimes(30, 180).Build();

            filter.ToString().Should().Be("runtimes=30-180");
        }
コード例 #6
0
        public void Test_TraktMovieFilterBuilder_ToString_With_Countries()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.WithCountries("gb", "us").Build();

            filter.ToString().Should().Be("countries=gb,us");
        }
コード例 #7
0
        public void Test_TraktMovieFilterBuilder_ToString_With_Languages()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.WithLanguages("de", "en").Build();

            filter.ToString().Should().Be("languages=de,en");
        }
コード例 #8
0
        public void Test_TraktMovieFilterBuilder_ToString_With_Genres()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.WithGenres("action", "drama").Build();

            filter.ToString().Should().Be("genres=action,drama");
        }
コード例 #9
0
        public void Test_TraktMovieFilterBuilder_ToString_With_Years_Reversed()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.WithYears(2018, 2016).Build();

            filter.ToString().Should().Be("years=2016-2018");
        }
コード例 #10
0
        public void Test_TraktMovieFilterBuilder_ToString_With_Query()
        {
            ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.WithQuery("query").Build();

            filter.ToString().Should().Be("query=query");
        }