public void Create_ValidEvent_ReturnsEventRegistrationResponse(WireDataFormat format) { //arrange var client = TestContext.CreateClientValidCredentials(format); var teamResources = new TeamApi(client.HttpChannel); var fundraiseResources = new PageApi(client.HttpChannel); var validRegisterPageRequest = ValidRegisterPageRequest(); var validRequest = ValidTeamRequest(validRegisterPageRequest.PageShortName); fundraiseResources.Create(validRegisterPageRequest); //act var result = teamResources.CreateOrUpdate(validRequest); //assert Assert.That(result.Id, Is.Not.EqualTo(0)); }
public void Retrieve_AndATeamExists_ReturnsTeam(WireDataFormat format) { //arrange var client = TestContext.CreateClientValidCredentials(format); var teamResources = new TeamApi(client.HttpChannel); var fundraiseResources = new PageApi(client.HttpChannel); var validRegisterPageRequest = ValidRegisterPageRequest(); fundraiseResources.Create(validRegisterPageRequest); var validRequest = ValidTeamRequest(validRegisterPageRequest.PageShortName); var response = teamResources.CreateOrUpdate(validRequest); //act var result = teamResources.Retrieve(validRequest.TeamShortName); //assert Assert.That(result.Id, Is.EqualTo(response.Id)); }
public void JointTeam_WhenProvidedValidRequestAndValidCredentials_ReturnTrue(WireDataFormat format) { //arrange var client = TestContext.CreateClientValidCredentials(format); var teamResources = new TeamApi(client.HttpChannel); var fundraisingResources = new PageApi(client.HttpChannel); var validRegisterPageRequest = ValidRegisterPageRequest(); fundraisingResources.Create(validRegisterPageRequest); var validTeamRequest = ValidTeamRequest(validRegisterPageRequest.PageShortName); teamResources.CreateOrUpdate(validTeamRequest); var validRegisterPageRequestSecond = ValidRegisterPageRequest(); fundraisingResources.Create(validRegisterPageRequestSecond); var validJoinTeamRequest = ValidJoinTeamRequest(validRegisterPageRequestSecond.PageShortName); //act var result = teamResources.JointTeam(validTeamRequest.TeamShortName, validJoinTeamRequest); //assert Assert.IsTrue(result); }