Код: Выделить всё
var mon = JobStorage.Current.GetMonitoringApi();
var scheduledJobs = mon.ScheduledJobs(0, int.MaxValue);
var jobsToDelete = scheduledJobs.Where(job => job.Value.Job?.Args?.Any(arg => arg is Guid guid && guid == id) == true).ToList();
jobsToDelete?.ForEach(job => _backgroundJobClient.Delete(job.Key));
Код: Выделить всё
_backgroundJobClientMock.Verify(x => x.Create(
It.Is(job => job.Method.Name == "Run" && Guid.Parse(job.Args[0].ToString()) == input),
It.IsAny()));
Код: Выделить всё
_backgroundJobClientMock.Verify(
x => x.Delete(It.Is(jobId => jobId == "job1")),
Times.Once
);
Подробнее здесь: https://stackoverflow.com/questions/793 ... it-testing
Мобильная версия