You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.1 KiB

using Xunit;
using TMDbLib.Objects.Discover;
using TMDbLib.Objects.General;
using System.Linq;
using TMDbLib.Objects.Search;
using TMDbLibTests.Helpers;
using TMDbLibTests.JsonHelpers;
namespace TMDbLibTests
{
public class ClientDiscoverTests : TestBase
{
[Fact]
public void TestDiscoverTvShowsNoParams()
{
// Ignore missing json
IgnoreMissingJson("results[array] / media_type");
TestHelpers.SearchPages(i => Config.Client.DiscoverTvShowsAsync().Query(i).Result);
SearchContainer<SearchTv> result = Config.Client.DiscoverTvShowsAsync().Query().Result;
Assert.NotNull(result);
Assert.Equal(1, result.Page);
Assert.NotNull(result.Results);
Assert.True(result.Results.Any());
}
[Fact]
public void TestDiscoverTvShows()
{
// Ignore missing json
IgnoreMissingJson("results[array] / media_type");
DiscoverTv query = Config.Client.DiscoverTvShowsAsync()
.WhereVoteCountIsAtLeast(100)
.WhereVoteAverageIsAtLeast(2);
TestHelpers.SearchPages(i => query.Query(i).Result);
}
[Fact]
public void TestDiscoverMoviesNoParams()
{
// Ignore missing json
IgnoreMissingJson("results[array] / media_type");
TestHelpers.SearchPages(i => Config.Client.DiscoverMoviesAsync().Query(i).Result);
SearchContainer<SearchMovie> result = Config.Client.DiscoverMoviesAsync().Query().Result;
Assert.NotNull(result);
Assert.Equal(1, result.Page);
Assert.NotNull(result.Results);
Assert.True(result.Results.Any());
}
[Fact]
public void TestDiscoverMovies()
{
// Ignore missing json
IgnoreMissingJson("results[array] / media_type");
DiscoverMovie query = Config.Client.DiscoverMoviesAsync()
.WhereVoteCountIsAtLeast(1000)
.WhereVoteAverageIsAtLeast(2);
TestHelpers.SearchPages(i => query.Query(i).Result);
}
}
}