0

I have created a Hangfire Background job that triggers the failed job as per some CRON schedule. I am facing issues to write Unit test case for the same, specially in mocking for 1st 2 lines. Framework used: xUnit, FakeItEasy

var monitor = JobStorage.Current.GetMonitoringApi();

var failedJobs = monitor.FailedJobs(0, int.MaxValue).Where(m => (m.Value.ExceptionType == "My Custom Exception");

Parallel.ForEach(failedJobs, job =>

{ backgroundJobClient.Requeue(job.Key);

});

Sharad
  • 435
  • 1
  • 5
  • 18

0 Answers0