public void Test_TraktMovieFilterBuilder_GetParameters() { 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.GetParameters().Should().NotBeNull().And.HaveCount(8); 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" } }); }
public void Test_TraktMovieFilterBuilder_GetParameters_With_Years() { ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.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_TraktMovieFilterBuilder_GetParameters_With_Query() { ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.WithQuery("query").Build(); filter.GetParameters().Should().NotBeNull().And.HaveCount(1); filter.GetParameters().Should().Contain(new Dictionary <string, object>() { { "query", "query" } }); }
public void Test_TraktMovieFilterBuilder_GetParameters_With_Ratings() { ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.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_TraktMovieFilterBuilder_GetParameters_With_Certifications() { ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.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_TraktMovieFilterBuilder_GetParameters_With_Runtimes() { ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.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_TraktMovieFilterBuilder_GetParameters_With_Countries() { ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.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_TraktMovieFilterBuilder_GetParameters_With_Languages() { ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.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_TraktMovieFilterBuilder_GetParameters_With_Genres() { ITraktMovieFilter filter = TraktFilterDirectory.MovieFilter.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_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(); }
private void SetupPathParamters() { var strExtendedInfo = _extendedInfo.ToString(); var filterParameters = _filter.GetParameters(); var strTimePeriod = _timePeriod.UriName; var strPage = _page.ToString(); var strLimit = _limit.ToString(); _data.Add(new object[] { _request1.GetUriPathParameters(), new Dictionary <string, object>() }); _data.Add(new object[] { _request2.GetUriPathParameters(), new Dictionary <string, object> { ["extended"] = strExtendedInfo } }); _data.Add(new object[] { _request3.GetUriPathParameters(), new Dictionary <string, object>(filterParameters) }); _data.Add(new object[] { _request4.GetUriPathParameters(), new Dictionary <string, object> { ["period"] = strTimePeriod } }); _data.Add(new object[] { _request5.GetUriPathParameters(), new Dictionary <string, object> { ["page"] = strPage } }); _data.Add(new object[] { _request6.GetUriPathParameters(), new Dictionary <string, object> { ["limit"] = strLimit } }); _data.Add(new object[] { _request7.GetUriPathParameters(), new Dictionary <string, object>(filterParameters) { ["extended"] = strExtendedInfo } }); _data.Add(new object[] { _request8.GetUriPathParameters(), new Dictionary <string, object> { ["extended"] = strExtendedInfo, ["period"] = strTimePeriod } }); _data.Add(new object[] { _request9.GetUriPathParameters(), new Dictionary <string, object> { ["extended"] = strExtendedInfo, ["page"] = strPage } }); _data.Add(new object[] { _request10.GetUriPathParameters(), new Dictionary <string, object> { ["extended"] = strExtendedInfo, ["limit"] = strLimit } }); _data.Add(new object[] { _request11.GetUriPathParameters(), new Dictionary <string, object> { ["extended"] = strExtendedInfo, ["page"] = strPage, ["limit"] = strLimit } }); _data.Add(new object[] { _request12.GetUriPathParameters(), new Dictionary <string, object>(filterParameters) { ["period"] = strTimePeriod } }); _data.Add(new object[] { _request13.GetUriPathParameters(), new Dictionary <string, object>(filterParameters) { ["page"] = strPage } }); _data.Add(new object[] { _request14.GetUriPathParameters(), new Dictionary <string, object>(filterParameters) { ["limit"] = strLimit } }); _data.Add(new object[] { _request15.GetUriPathParameters(), new Dictionary <string, object>(filterParameters) { ["page"] = strPage, ["limit"] = strLimit } }); _data.Add(new object[] { _request16.GetUriPathParameters(), new Dictionary <string, object> { ["period"] = strTimePeriod, ["page"] = strPage } }); _data.Add(new object[] { _request17.GetUriPathParameters(), new Dictionary <string, object> { ["period"] = strTimePeriod, ["limit"] = strLimit } }); _data.Add(new object[] { _request18.GetUriPathParameters(), new Dictionary <string, object> { ["period"] = strTimePeriod, ["page"] = strPage, ["limit"] = strLimit } }); _data.Add(new object[] { _request19.GetUriPathParameters(), new Dictionary <string, object> { ["page"] = strPage, ["limit"] = strLimit } }); _data.Add(new object[] { _request20.GetUriPathParameters(), new Dictionary <string, object>(filterParameters) { ["extended"] = strExtendedInfo, ["period"] = strTimePeriod, ["page"] = strPage, ["limit"] = strLimit } }); }