コード例 #1
0
 private void SetupSuccessfulGfyCreation()
 {
     A.CallTo(() => _fakeGfyCatApi.CreateGfy($"Bearer {FakeToken}", A <GfyCatCreationParameters> ._))
     .Returns(new GfyCreationResponse
     {
         IsOk    = true,
         GfyName = FakeGfyName
     });
 }
コード例 #2
0
        public async Task <string> UploadAsync()
        {
            string token = await GetAuthToken();

            var gfyCreationResponse = await _gfyCatApi.CreateGfy($"Bearer {token}", new GfyCatCreationParameters { KeepAudio = true });

            if (gfyCreationResponse.IsOk)
            {
                return(await UploadVideoAndReturnMp4Url(gfyCreationResponse.GfyName));
            }
            else
            {
                throw new VideoUploadException("Gfy creation was not successful");
            }
        }