mirror of https://github.com/LordMike/TMDbLib.git
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.
106 lines
4.1 KiB
106 lines
4.1 KiB
using System.Threading.Tasks;
|
|
using Xunit;
|
|
using TMDbLib.Objects.Find;
|
|
using TMDbLibTests.Helpers;
|
|
using TMDbLibTests.JsonHelpers;
|
|
|
|
namespace TMDbLibTests
|
|
{
|
|
public class ClientFindTests : TestBase
|
|
{
|
|
[Fact]
|
|
public void TestFindImdbMovie()
|
|
{
|
|
// Ignore missing json
|
|
IgnoreMissingJson("movie_results[array] / media_type");
|
|
|
|
Task<FindContainer> result = Config.Client.FindAsync(FindExternalSource.Imdb, IdHelper.ImdbTerminatorId);
|
|
Assert.Equal(1, result.Result.MovieResults.Count);
|
|
Assert.Equal(IdHelper.TmdbTerminatorId, result.Result.MovieResults[0].Id);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestFindImdbPerson()
|
|
{
|
|
// Ignore missing json
|
|
IgnoreMissingJson("person_results[array] / media_type");
|
|
|
|
Task<FindContainer> result = Config.Client.FindAsync(FindExternalSource.Imdb, IdHelper.ImdbBruceWillis);
|
|
Assert.Equal(1, result.Result.PersonResults.Count);
|
|
Assert.Equal(IdHelper.BruceWillis, result.Result.PersonResults[0].Id);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestFindImdbTvShowEpisode()
|
|
{
|
|
Task<FindContainer> result = Config.Client.FindAsync(FindExternalSource.Imdb, IdHelper.ImdbBreakingBadSeason1Episode1Id);
|
|
Assert.Equal(1, result.Result.TvEpisode.Count);
|
|
Assert.Equal(IdHelper.BreakingBadSeason1Episode1Id, result.Result.TvEpisode[0].Id);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestFindImdbTvShowSeason()
|
|
{
|
|
Task<FindContainer> result = Config.Client.FindAsync(FindExternalSource.TvDb, IdHelper.TvdbBreakingBadSeason1Id);
|
|
Assert.Equal(1, result.Result.TvEpisode.Count);
|
|
|
|
Assert.Equal(1, result.Result.TvSeason.Count);
|
|
Assert.Equal(IdHelper.BreakingBadSeason1Id, result.Result.TvSeason[0].Id);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestFindTvdbTvShow()
|
|
{
|
|
// Ignore missing json
|
|
IgnoreMissingJson("tv_results[array] / media_type");
|
|
|
|
Task<FindContainer> result = Config.Client.FindAsync(FindExternalSource.TvDb, IdHelper.TvdbBreakingBadId);
|
|
Assert.Equal(1, result.Result.TvResults.Count);
|
|
Assert.Equal(IdHelper.TmdbBreakingBadId, result.Result.TvResults[0].Id);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestFindImdbTvShow()
|
|
{
|
|
// Ignore missing json
|
|
IgnoreMissingJson("tv_results[array] / media_type");
|
|
|
|
Task<FindContainer> result = Config.Client.FindAsync(FindExternalSource.Imdb, IdHelper.ImdbBreakingBadId);
|
|
Assert.Equal(1, result.Result.TvResults.Count);
|
|
Assert.Equal(IdHelper.TmdbBreakingBadId, result.Result.TvResults[0].Id);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestFindTvRageTvShow()
|
|
{
|
|
// Ignore missing json
|
|
IgnoreMissingJson("tv_results[array] / media_type");
|
|
|
|
Task<FindContainer> result = Config.Client.FindAsync(FindExternalSource.TvRage, IdHelper.TvRageBreakingBadId);
|
|
Assert.Equal(1, result.Result.TvResults.Count);
|
|
Assert.Equal(IdHelper.TmdbBreakingBadId, result.Result.TvResults[0].Id);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestFindFreebaseTvShow()
|
|
{
|
|
// Ignore missing json
|
|
IgnoreMissingJson("tv_results[array] / media_type");
|
|
|
|
Task<FindContainer> result = Config.Client.FindAsync(FindExternalSource.FreeBaseId, IdHelper.FreebaseBreakingBadId);
|
|
Assert.Equal(1, result.Result.TvResults.Count);
|
|
Assert.Equal(IdHelper.TmdbBreakingBadId, result.Result.TvResults[0].Id);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestFindFreebaseMidTvShow()
|
|
{
|
|
// Ignore missing json
|
|
IgnoreMissingJson("tv_results[array] / media_type");
|
|
|
|
Task<FindContainer> result = Config.Client.FindAsync(FindExternalSource.FreeBaseMid, IdHelper.FreebaseMidBreakingBadId);
|
|
Assert.Equal(1, result.Result.TvResults.Count);
|
|
Assert.Equal(IdHelper.TmdbBreakingBadId, result.Result.TvResults[0].Id);
|
|
}
|
|
}
|
|
}
|