2014-12-11 01:46:46 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
using TMDbLib.Objects.General;
|
2016-05-22 12:10:30 +00:00
|
|
|
|
using TMDbLibTests.JsonHelpers;
|
2014-12-11 01:46:46 +00:00
|
|
|
|
|
|
|
|
|
namespace TMDbLibTests
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
2016-05-22 12:10:30 +00:00
|
|
|
|
public class ClientJobTests : TestBase
|
2014-12-11 01:46:46 +00:00
|
|
|
|
{
|
|
|
|
|
private TestConfig _config;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Run once, on every test
|
|
|
|
|
/// </summary>
|
|
|
|
|
[TestInitialize]
|
2016-05-22 12:10:30 +00:00
|
|
|
|
public override void Initiator()
|
2014-12-11 01:46:46 +00:00
|
|
|
|
{
|
2016-05-22 12:10:30 +00:00
|
|
|
|
base.Initiator();
|
|
|
|
|
|
2014-12-11 01:46:46 +00:00
|
|
|
|
_config = new TestConfig();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void TestJobList()
|
|
|
|
|
{
|
2016-02-22 20:55:27 +00:00
|
|
|
|
List<Job> jobs = _config.Client.GetJobsAsync().Result;
|
2014-12-11 01:46:46 +00:00
|
|
|
|
|
|
|
|
|
Assert.IsNotNull(jobs);
|
|
|
|
|
Assert.IsTrue(jobs.Count > 0);
|
|
|
|
|
|
2015-06-24 22:43:33 +00:00
|
|
|
|
Assert.IsTrue(jobs.All(job => !string.IsNullOrEmpty(job.Department)));
|
2014-12-11 01:46:46 +00:00
|
|
|
|
Assert.IsTrue(jobs.All(job => job.JobList != null));
|
|
|
|
|
Assert.IsTrue(jobs.All(job => job.JobList.Count > 0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|