public void GivenVideoFileIsFound_WhenVideoRotationIsRequested_ThenFfmpegCommandWithArgsIsCalledAndVideoIsRotated() { // Arrange CreateVideoFile(); CreateRotatedVideoFile(); // Act Invoking(() => _ffmpegVideoRotator.Rotate("cw")).Should().NotThrow(); // Assert A.CallTo(() => _fakeFfmpegExecutor.ExecuteFfmpegCommandWithArgString(A <string> ._)).MustHaveHappenedOnceExactly(); }
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); }
private void RotateVideo(string rotationArg) { _videoRotator.Rotate(rotationArg); }