Пример #1
0
 public void Result_ShouldBeSaved_WhenOverwriting()
 {
     SampleBinaryFile sampleBinaryFile1 = new SampleBinaryFile(SampleFilenames.TemporaryFileToWrite, SampleByteArrays.ArrayToSearch);
       SampleBinaryFile sampleBinaryFile2 = new SampleBinaryFile(SampleFilenames.TemporaryFileToWrite, SampleByteArrays.PatternThatExists);
       WriteFile writeFile1 = new WriteFile(sampleBinaryFile1);
       WriteFile writeFile = new WriteFile(sampleBinaryFile2);
       Assert.AreEqual(FileResult.Success, writeFile.Result);
       System.IO.File.Delete(SampleFilenames.TemporaryFileToWrite);
 }
Пример #2
0
        public static Mp4RepairJob OneFileWithoutOldDimensions()
        {
            CreateTempDirectory();
              CreateSampleFilesWithStandardByteArray();

              SampleBinaryFile sampleBinaryFile = new SampleBinaryFile(SampleFilenames.TempDirectory + "SampleFile_0007.mp4", SampleByteArrays.ArrayToSearchWithoutPattern, FileResult.Success);
              WriteFile overwriteOneFile = new WriteFile(sampleBinaryFile);

              Dimension oldDimensions = new Dimension(320, 240);
              Dimension newDimensions = new Dimension(640, 480);
              FileSaveRule fileSaveRule = new FileSaveRule(string.Empty, string.Empty, SampleFilenames.TempDestinationDirectory);

              return new Mp4RepairJob(SampleFilenames.TempDirectory, oldDimensions, newDimensions, fileSaveRule);
        }
Пример #3
0
        private static void CreateSampleFilesAndNonMp4Files()
        {
            for (int i = 1; i <= 15; i++)
              {
            byte[] b = SampleByteArrays.ArrayToSearch;
            WriteFile f = new WriteFile(new SampleBinaryFile(SampleFilenames.TempDirectory + "SampleFile_00" + i.ToString("D2") + ".mp4", b, FileResult.Success));
              }

              for (int i = 1; i <= 15; i++)
              {
            byte[] b = SampleByteArrays.ArrayToSearch;
            WriteFile f = new WriteFile(new SampleBinaryFile(SampleFilenames.TempDirectory + "SampleFile_00" + i.ToString("D2") + ".bin", b, FileResult.Success));
              }
        }
Пример #4
0
 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;
 }