public async Task GivenRotatedVideoExists_WhenVideoUploadIsCalled_ThenVideoFileIsUploadedAndUrlIsReturned()
        {
            // Arrange
            CreateRotatedVideoFile();
            SetupSuccessfulApiCallStubs();

            // Act
            var gfyCatUrl = await _gfyCatVideoUploader.UploadAsync();

            // Assert
            A.CallTo(() => _fakeGfyCatFileDropApi.UploadVideoFromFile(FakeGfyName, A <StreamPart> ._)).MustHaveHappenedOnceExactly();
            Assert.Equal($"https://giant.gfycat.com/{FakeGfyName}.mp4", gfyCatUrl);
        }
Beispiel #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);
        }
Beispiel #3
0
 private async Task <string> UploadVideoAsync()
 {
     return(await _videoUploader.UploadAsync());
 }