public AddFundraisingPageVideoConfirmation AddVideo(AddFundraisingPageVideoRequest request) { var locationFormat = FundraisingPageVideosLocationFormat(request.PageShortName); return (HttpChannel.PerformRequest <AddFundraisingPageVideoRequest, AddFundraisingPageVideoConfirmation>("PUT", locationFormat, request)); }
public void AddFundraisingPageVideo_WhenCredentialsValidAndRequestValid_ReturnsSuccessful(WireDataFormat format) { //arrange var client = TestContext.CreateClientValidCredentials(format); var pageClient = new PageApi(client.HttpChannel); var pageCreationRequest = ValidRegisterPageRequest(); pageClient.Create(pageCreationRequest); var addVideoRequest = new AddFundraisingPageVideoRequest { Url = "http://www.youtube.com/watch?v=MSxjbF18BBM", Caption = "neckbrace", PageShortName = pageCreationRequest.PageShortName }; //act var result = pageClient.AddVideo(addVideoRequest); //assert Assert.IsNotNullOrEmpty(result.Next.Rel); }
public void AddFundraisingPageVideo_WhenCredentialsValidAndRequestNotValid_ThrowsException(WireDataFormat format) { //arrange var client = TestContext.CreateClientValidCredentials(format); var pageClient = new PageApi(client.HttpChannel); var pageCreationRequest = ValidRegisterPageRequest(); pageClient.Create(pageCreationRequest); var addVideoRequest = new AddFundraisingPageVideoRequest { Url = "", Caption = "", PageShortName = pageCreationRequest.PageShortName }; //act var response = Assert.Throws <ErrorResponseException>(() => pageClient.AddVideo(addVideoRequest)); //arrange Assert.That(response.Response.StatusCode, Is.EqualTo(HttpStatusCode.BadRequest)); }
public void AddVideoAsync(AddFundraisingPageVideoRequest request, Action <AddFundraisingPageVideoConfirmation> callback) { var locationFormat = FundraisingPageVideosLocationFormat(request.PageShortName); HttpChannel.PerformRequestAsync("PUT", locationFormat, request, callback); }