Exemple #1
0
        public void GivenVideoFileIsFound_WhenVideoRotationIsRequested_ThenFfmpegCommandWithArgsIsCalledAndVideoIsRotated()
        {
            // Arrange
            CreateVideoFile();
            CreateRotatedVideoFile();

            // Act
            Invoking(() => _ffmpegVideoRotator.Rotate("cw")).Should().NotThrow();

            // Assert
            A.CallTo(() => _fakeFfmpegExecutor.ExecuteFfmpegCommandWithArgString(A <string> ._)).MustHaveHappenedOnceExactly();
        }
Exemple #2
0
        public async Task GivenValidMediaProcessorParameters_WhenAllOperationsSucceed_ThenUrlOfUploadedVideoIsReturned()
        {
            // Arrange
            A.CallTo(() => _fakeGfyCatVideoUploader.UploadAsync()).Returns(UploadUrl);

            // Act
            var uploadUrl = await _mediaProcessor.DownloadAndRotateAndUploadVideo(GetValidMediaProcessorParameters());

            // Assert
            A.CallTo(() => _fakeAudioDownloader.DownloadFromUrl(AudioUrlString)).MustHaveHappenedOnceExactly();
            A.CallTo(() => _fakeVideoDownloader.DownloadFromUrl(VideoUrlString)).MustHaveHappenedOnceExactly();
            A.CallTo(() => _fakeMediaMuxer.CombineVideoAndAudio()).MustHaveHappenedOnceExactly();
            A.CallTo(() => _fakeVideoRotator.Rotate(RotationArgumentString)).MustHaveHappenedOnceExactly();
            A.CallTo(() => _fakeGfyCatVideoUploader.UploadAsync()).MustHaveHappenedOnceExactly();
            Assert.Equal(UploadUrl, uploadUrl);
        }
Exemple #3
0
 private void RotateVideo(string rotationArg)
 {
     _videoRotator.Rotate(rotationArg);
 }