public static IEnumerable<IExpectation> Expectations(Job job) { // Irrispective of whether the event was triggered by a *.dobbin.result.xml in the Job level // directory, or the tracks directory - we'll check to see that the job level set is complete. var jobLevelFiles = new string[] {}; try { jobLevelFiles = Directory.GetFiles(job.JobDirectory, job.Id + Pattern, SearchOption.TopDirectoryOnly); } catch(DirectoryNotFoundException e) { _log.Error("DobbinExpectation: Directory not found", e); } if (!jobLevelFiles.Any()) { yield return new FailExpectation("Job directory does not yet contain dobbin results files."); yield break; } if (jobLevelFiles.Count() < 4) { yield return new FailExpectation("Job directory does not yet contain all four dobbin result files."); yield break; } foreach (var file in jobLevelFiles) { yield return ReferenceToAudioFile(file); yield return StatusSuccess(file); } }
public Mover(Options options, Job job) { _options = options; _job = job; }