public void RunResult_VerifyBytesHavebeenChanged_InFilesThatContainThePattern() { Mp4RepairJob mp4RepairJob = SampleMp4RepairJobs.OneFileWithoutOldDimensions(); mp4RepairJob.Run(); List<JobResult> successes = mp4RepairJob.Results.FindAll(job => job.Passed == true); Assert.AreEqual(15, mp4RepairJob.Results.Count); Assert.AreEqual(14, successes.Count); foreach (JobResult result in successes) { LoadFile loadFile = new LoadFile(result.NewFilename); PatternMatch match = new PatternMatch(SampleByteArrays.Dimensions640x480, loadFile.Bytes); Assert.IsTrue(match.Success); } SampleMp4RepairJobs.DeleteTempDirectory(); }
private JobResult RunSingleRepairJob(string filename, int jobID) { var loadFile = new LoadFile(filename); var destination = new Destination(fileSaveRule, loadFile.Path); var modifiedFile = new ModifiedFile(loadFile.Bytes, oldDimensions.AsBytes, newDimensions.AsBytes, destination.Path); var writeFile = new WriteFile(modifiedFile); var jobResult = new JobResult(jobID, loadFile, modifiedFile, writeFile); return jobResult; }