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.

67 lines
1.9 KiB

7 years ago
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using Xunit;
  4. using TMDbLib.Objects.Timezones;
  5. using TMDbLibTests.Helpers;
  6. using TMDbLib.Objects.Countries;
  7. using TMDbLib.Objects.General;
  8. using TMDbLib.Objects.Languages;
  9. using TMDbLibTests.TestFramework;
  10. namespace TMDbLibTests
  11. {
  12. public class ClientConfigurationTests : TestBase
  13. {
  14. public ClientConfigurationTests(TestConfig testConfig) : base(testConfig)
  15. {
  16. }
  17. [Fact]
  18. public void TestCountryList()
  19. {
  20. List<Country> result = Config.Client.GetCountriesAsync().Sync();
  21. Assert.NotNull(result);
  22. Assert.True(result.Count > 200);
  23. Assert.Contains(result, c => c.EnglishName == "Denmark" && c.Iso_3166_1 == "DK");
  24. }
  25. [Fact]
  26. public void TestLanguageList()
  27. {
  28. List<Language> result = Config.Client.GetLanguagesAsync().Sync();
  29. Assert.NotNull(result);
  30. Assert.True(result.Count > 180);
  31. Assert.Contains(result, l => l.Name == "Dansk" && l.EnglishName == "Danish" && l.Iso_639_1 == "da");
  32. }
  33. [Fact]
  34. public void TestTimezonesList()
  35. {
  36. Timezones result = Config.Client.GetTimezonesAsync().Sync();
  37. Assert.NotNull(result);
  38. Assert.True(result.List.Count > 200);
  39. List<string> item = result.List["DK"];
  40. Assert.NotNull(item);
  41. Assert.Equal(1, item.Count);
  42. Assert.Equal("Europe/Copenhagen", item[0]);
  43. }
  44. [Fact]
  45. public void TestJobList()
  46. {
  47. List<Job> jobs = Config.Client.GetJobsAsync().Sync();
  48. Assert.NotNull(jobs);
  49. Assert.True(jobs.Count > 0);
  50. Assert.True(jobs.All(job => !string.IsNullOrEmpty(job.Department)));
  51. Assert.True(jobs.All(job => job.Jobs != null));
  52. Assert.True(jobs.All(job => job.Jobs.Count > 0));
  53. }
  54. }
  55. }