public async Task ReturnsSuccessAccountDetailsTest() { var videoId = await _testFileHelper.UploadTest(); videoId.ShouldNotBe(0); var result = await _testFileHelper.DeleteTestFile(videoId.ToString()); result.ShouldBe(System.Net.HttpStatusCode.NoContent); }
public async Task ReturnsDomainsVideoTest() { var videoId = await _testFileHelper.UploadTest(); var response = await _getDomainsVideoService .ExecuteAsync(videoId.ToString()); await _testFileHelper.DeleteTestFile(videoId.ToString()); response.Data.ShouldNotBe(null); }
public async Task ReturnsSuccessAddDomainToVideoTest() { var videoId = await _testFileHelper.UploadTest(); videoId.ShouldNotBe(0); var response = await _addDomainToVideoService .ExecuteAsync(new AddDomainToVideoRequest(videoId, "localhost:5010")); await _testFileHelper.DeleteTestFile(videoId.ToString()); response.Data.ShouldBeTrue(); }
public async Task ReturnsOEmbedVideoTest() { var videoId = await _testFileHelper.UploadTest(); videoId.ShouldNotBe(0); var videoLink = $"https://vimeo.com/videos/{videoId}"; var response = await _getOEmbedVideoService .ExecuteAsync(videoLink); await _testFileHelper.DeleteTestFile(videoId.ToString()); response.Code.ShouldBe(System.Net.HttpStatusCode.NotFound); }
public async Task ReturnsSuccessAddAnimatedThumbnailsTest() { var videoId = await _testFileHelper.UploadTest(); videoId.ShouldNotBe(0); Video video = new Video(); while (video.Status != "available") { Thread.Sleep(20 * 1000); video = (await _getVideoService.ExecuteAsync(videoId.ToString())).Data; } var request = new AddAnimatedThumbnailsToVideoRequest(videoId, START_TIME, DURATION); var result = await _addAnimatedThumbnailsToVideoService.ExecuteAsync(request); result.ShouldNotBeNull(); result.Code.ShouldNotBe(HttpStatusCode.BadRequest); var status = string.Empty; var getStatusAnimatedThumbnailRequest = new GetAnimatedThumbnailRequest(videoId, result.Data.PictureId); while (status != "completed") { var statusResult = await _getStatusAnimatedThumbnailService.ExecuteAsync(getStatusAnimatedThumbnailRequest); statusResult.Code.ShouldNotBe(HttpStatusCode.BadRequest); status = statusResult.Data.Status; Thread.Sleep(5 * 1000); } var getAnimatedThumbnailResult = await _getAnimatedThumbnailService.ExecuteAsync(getStatusAnimatedThumbnailRequest); getAnimatedThumbnailResult.Code.ShouldNotBe(HttpStatusCode.BadRequest); var deleteResult = await _testFileHelper.DeleteTestFile(videoId.ToString()); deleteResult.ShouldBe(System.Net.HttpStatusCode.NoContent); }