Пример #1
0
		public void TeamExists_AndATeamDoesntExist_ReturnsFalse(WireDataFormat format)
        {
            //arrange
            var client = TestContext.CreateClientValidCredentials(format);
            var teamResources = new TeamApi(client.HttpChannel);
			
            //act
            var result = teamResources.TeamExists(Guid.NewGuid().ToString());

            //act
            Assert.That(result, Is.False);
        }
Пример #2
0
        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));
        }
Пример #3
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));
		}
Пример #4
0
        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);
        }
 	private void WithAValidClient(WireDataFormat format = WireDataFormat.Xml)
 	{
 		_client = TestContext.CreateClientValidCredentials(format);
 		_api = new TeamApi(_client.HttpChannel);
 	}