public void ProcessResults_Populates_MultipleJobs() { var reqProc = new ComplianceRequestProcessor <ComplianceQuery> { BaseUrl = BaseUrl2, Type = ComplianceType.MultipleJobs }; List <ComplianceQuery> results = reqProc.ProcessResults(MultipleJobs); Assert.IsNotNull(results); ComplianceQuery complianceQuery = results.SingleOrDefault(); Assert.IsNotNull(complianceQuery); List <ComplianceJob> jobs = complianceQuery.Jobs; Assert.IsNotNull(jobs); Assert.AreEqual(2, jobs.Count); ComplianceJob job = jobs.FirstOrDefault(); Assert.IsNotNull(job); Assert.AreEqual("NIXh2p", job.JobID); Assert.AreEqual("Feline species research", job.JobName); Assert.AreEqual("https://storage.googleapis.com/twitter-compliance/test_user_ids", job.DownloadUrl); Assert.AreEqual(DateTime.Parse("2020-06-16T11:17:32.819+00:00"), job.DownloadExpiresAt); Assert.AreEqual(ComplianceStatus.Complete, job.Status); }
public void ProcessResults_Populates_SingleJob() { var reqProc = new ComplianceRequestProcessor <ComplianceQuery> { BaseUrl = BaseUrl2, Type = ComplianceType.SingleJob }; List <ComplianceQuery> results = reqProc.ProcessResults(SingleJob); Assert.IsNotNull(results); ComplianceQuery complianceQuery = results.SingleOrDefault(); Assert.IsNotNull(complianceQuery); List <ComplianceJob> jobs = complianceQuery.Jobs; Assert.IsNotNull(jobs); Assert.AreEqual(1, jobs.Count); ComplianceJob job = jobs.FirstOrDefault(); Assert.IsNotNull(job); Assert.AreEqual("jU8rFK", job.JobID); Assert.AreEqual("Troglomyces twitteri", job.JobName); Assert.AreEqual("https://storage.googleapis.com/twitter-compliance/test_user_ids", job.DownloadUrl); Assert.AreEqual(DateTime.Parse("2020-09-04T20:04:41.819+00:00"), job.DownloadExpiresAt); Assert.AreEqual(ComplianceStatus.Complete, job.Status); }
public void ProcessResults_WithNoResults_ReturnsNoJobs() { var reqProc = new ComplianceRequestProcessor <ComplianceQuery> { BaseUrl = BaseUrl2 }; List <ComplianceQuery> results = reqProc.ProcessResults(ErrorTweet); Assert.IsNotNull(results); ComplianceQuery complianceQuery = results.SingleOrDefault(); Assert.IsNotNull(complianceQuery); List <ComplianceJob> jobs = complianceQuery.Jobs; Assert.IsNull(jobs); }
public void ProcessResults_ForSingleJob_PopulatesInputParameters() { var reqProc = new ComplianceRequestProcessor <ComplianceQuery>() { BaseUrl = BaseUrl2, Type = ComplianceType.SingleJob, ID = "123" }; var results = reqProc.ProcessResults(SingleJob); Assert.IsNotNull(results); Assert.AreEqual(1, results.Count); var complianceQuery = results.Single(); Assert.IsNotNull(complianceQuery); Assert.AreEqual(ComplianceType.SingleJob, complianceQuery.Type); Assert.AreEqual("123", complianceQuery.ID); }
public void ProcessResults_ForMultipleJobs_PopulatesInputParameters() { var reqProc = new ComplianceRequestProcessor <ComplianceQuery>() { BaseUrl = BaseUrl2, Type = ComplianceType.MultipleJobs, EndTime = new DateTime(2020, 12, 31), StartTime = new DateTime(2020, 1, 1), Status = ComplianceStatus.Complete }; var results = reqProc.ProcessResults(SingleJob); Assert.IsNotNull(results); Assert.AreEqual(1, results.Count); var complianceQuery = results.Single(); Assert.IsNotNull(complianceQuery); Assert.AreEqual(ComplianceType.MultipleJobs, complianceQuery.Type); Assert.AreEqual(new DateTime(2020, 12, 31), complianceQuery.EndTime); Assert.AreEqual(new DateTime(2020, 1, 1), complianceQuery.StartTime); Assert.AreEqual(ComplianceStatus.Complete, complianceQuery.Status); }