2018-02-02 01:17:10 +00:00
|
|
|
using System.Collections.Generic;
|
2014-12-11 01:46:46 +00:00
|
|
|
using System.Linq;
|
2018-02-02 01:17:10 +00:00
|
|
|
using Xunit;
|
|
|
|
using TMDbLib.Objects.Timezones;
|
|
|
|
using TMDbLibTests.Helpers;
|
|
|
|
using TMDbLibTests.JsonHelpers;
|
|
|
|
using TMDbLib.Objects.Countries;
|
2018-04-10 13:07:12 +00:00
|
|
|
using TMDbLib.Objects.General;
|
2018-02-02 01:17:10 +00:00
|
|
|
using TMDbLib.Objects.Languages;
|
|
|
|
|
|
|
|
namespace TMDbLibTests
|
|
|
|
{
|
|
|
|
public class ClientConfigurationTests : TestBase
|
|
|
|
{
|
|
|
|
[Fact]
|
|
|
|
public void TestCountryList()
|
|
|
|
{
|
|
|
|
List<Country> result = Config.Client.GetCountriesAsync().Sync();
|
|
|
|
|
|
|
|
Assert.NotNull(result);
|
|
|
|
Assert.True(result.Count > 200);
|
|
|
|
|
|
|
|
Assert.Contains(result, c => c.EnglishName == "Denmark" && c.Iso_3166_1 == "DK");
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public void TestLanguageList()
|
|
|
|
{
|
|
|
|
List<Language> result = Config.Client.GetLanguagesAsync().Sync();
|
|
|
|
|
|
|
|
Assert.NotNull(result);
|
|
|
|
Assert.True(result.Count > 180);
|
|
|
|
|
|
|
|
Assert.Contains(result, l => l.Name == "Dansk" && l.EnglishName == "Danish" && l.Iso_639_1 == "da");
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public void TestTimezonesList()
|
|
|
|
{
|
|
|
|
Timezones result = Config.Client.GetTimezonesAsync().Sync();
|
|
|
|
|
|
|
|
Assert.NotNull(result);
|
|
|
|
Assert.True(result.List.Count > 200);
|
|
|
|
|
|
|
|
List<string> item = result.List["DK"];
|
|
|
|
Assert.NotNull(item);
|
|
|
|
Assert.Equal(1, item.Count);
|
|
|
|
Assert.Equal("Europe/Copenhagen", item[0]);
|
|
|
|
}
|
2018-04-10 13:07:12 +00:00
|
|
|
|
2016-07-18 21:23:38 +00:00
|
|
|
[Fact]
|
2014-12-11 01:46:46 +00:00
|
|
|
public void TestJobList()
|
|
|
|
{
|
2016-07-18 21:26:27 +00:00
|
|
|
List<Job> jobs = Config.Client.GetJobsAsync().Sync();
|
2014-12-11 01:46:46 +00:00
|
|
|
|
2016-07-18 21:23:38 +00:00
|
|
|
Assert.NotNull(jobs);
|
|
|
|
Assert.True(jobs.Count > 0);
|
2014-12-11 01:46:46 +00:00
|
|
|
|
2016-07-18 21:23:38 +00:00
|
|
|
Assert.True(jobs.All(job => !string.IsNullOrEmpty(job.Department)));
|
2018-01-24 21:45:37 +00:00
|
|
|
Assert.True(jobs.All(job => job.Jobs != null));
|
|
|
|
Assert.True(jobs.All(job => job.Jobs.Count > 0));
|
2014-12-11 01:46:46 +00:00
|
|
|
}
|
2018-02-02 01:17:10 +00:00
|
|
|
}
|
|
|
|
}
|