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)); }