public void Register_SuppliedValidAuthenticationAndValidRegisterPageRequestWithCompanyAppealId_CanRetrieveCompanyId(WireDataFormat format) { //arrange var client = TestContext.CreateClientValidCredentials(format); var pageClient = new PageApi(client.HttpChannel); var pageShortName = "api-test-" + Guid.NewGuid(); const int companyAppealId = 200002; var pageCreationRequest = new RegisterPageRequest { CompanyAppealId = companyAppealId, ActivityType = null, PageShortName = pageShortName, PageTitle = "api test", EventName = "The Other Occasion of ApTest and APITest", CharityId = 2050, EventId = TestConfigurationsHelper.GetProperty <ITestConfigurations, int>(x => x.ValidEventId), TargetAmount = 20M, EventDate = DateTime.Now.AddDays(5) }; pageClient.Create(pageCreationRequest); //act var result = pageClient.Retrieve(pageShortName); //assert Assert.That(result.CompanyAppealId, Is.EqualTo(companyAppealId)); }
public void IsPageShortNameRegistered_WhenSuppliedPageNameUnlikelyToExistOnNonDefaultDomain_ReturnsFalse(WireDataFormat format) { //arrange var client = TestContext.CreateClientInvalidCredentials(format); var pageClient = new PageApi(client.HttpChannel); //act var exists = pageClient.IsPageShortNameRegistered("rasha25", TestConfigurationsHelper.GetProperty <ITestConfigurations, string>(x => x.RflDomain)); //assert Assert.IsFalse(exists); }
private static RegisterPageRequest ValidRegisterPageRequest() { return(new RegisterPageRequest { ActivityType = null, PageShortName = "test-frp-" + Guid.NewGuid(), PageTitle = "When Provided With Valid Authentication Details And An Empty Activity Type - Creates New Page", EventName = "The Other Occasion of ApTest and APITest", CharityId = 2050, EventId = TestConfigurationsHelper.GetProperty <ITestConfigurations, int>(x => x.ValidEventId), TargetAmount = 20M, EventDate = DateTime.Now.AddDays(5) }); }
public void Register_WhenProvidedWithValidAuthenticationAndDetailsAndAnEmptyActivityType_TheResponseContainsThePageId(WireDataFormat format) { var client = TestContext.CreateClientValidCredentials(format); var pageClient = new PageApi(client.HttpChannel); var pageShortName = "api-test-" + Guid.NewGuid(); var pageCreationRequest = new RegisterPageRequest { ActivityType = null, PageShortName = pageShortName, PageTitle = "api test", EventName = "The Other Occasion of ApTest and APITest", CharityId = 2050, EventId = TestConfigurationsHelper.GetProperty <ITestConfigurations, int>(x => x.ValidEventId), TargetAmount = 20M, EventDate = DateTime.Now.AddDays(5) }; var registrationResponse = pageClient.Create(pageCreationRequest); Assert.That(registrationResponse.PageId != 0); }