Пример #1
0
        public void DoWorkSetsCurrentTaskStateToCorrectValue(FfmpegJobModelState jobStatus, ExecutionState assertState)
        {
            mockFFMPegService = new Mock <IFFMpegService>();
            mockFFMPegService.Setup(m => m.PostAudioJob(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <ObservableCollection <AudioDestinationFormat> >(), null, null))
            .Returns(Guid.NewGuid());

            FfmpegJobModel job = new FfmpegJobModel()
            {
                State = jobStatus, Tasks = new ObservableCollection <FfmpegTaskModel>()
                {
                    new FfmpegTaskModel()
                    {
                        DestinationFilename = "\\\\sdfsdfsdf\\sdfgsdf\\1"
                    }
                }
            };

            mockFFMPegService.Setup(m => m.GetAudioJob(It.IsAny <Guid>())).Returns(job);

            sut          = new FFMpeg.FFMpeg(_pluginUrn, MockTimeProvider.Object, Logging, mockFFMPegService.Object, mockPresetProvider.Object);
            Task.To.Path = "\\\\sdfsdfsdf\\sdfgsdf";

            sut.Assign(Task);
            sut.Pulse(Task);

            Assert.That(Task.State, Is.EqualTo(assertState));
        }
Пример #2
0
        public void DoWorkDoesNotSetTargetFilesIfExecutionStateIsNotDone(FfmpegJobModelState FfmpegJobModel)
        {
            mockFFMPegService = new Mock <IFFMpegService>();
            mockFFMPegService.Setup(m => m.PostMuxAudioJob(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>()))
            .Returns(Guid.NewGuid());

            FFMpegClient.FfmpegJobModel job = new FFMpegClient.FfmpegJobModel()
            {
                State = FfmpegJobModel
            };
            mockFFMPegService.Setup(m => m.GetAudioJob(It.IsAny <Guid>())).Returns(job);

            sut = new FFMpeg.FFMpeg(_pluginUrn, MockTimeProvider.Object, Logging, mockFFMPegService.Object, mockPresetProvider.Object);

            sut.Assign(Task);
            sut.Pulse(Task);

            Assert.That(Task.To.Files, Is.Empty);
        }