public void ThenIShouldSeeStatusCodeIndicatingInternalServerError(int p0) { Assert.That( Assert.Throws <MemberApiProxyException>(async() => await MemberApiProxy.GetOnSiteMessagesAsync()) .StatusCode, Is.EqualTo(HttpStatusCode.InternalServerError)); Assert.That( Assert.Throws <MemberApiProxyException>(async() => await MemberApiProxy.GetBalancesSetAsync()) .StatusCode, Is.EqualTo(HttpStatusCode.InternalServerError)); Assert.That( Assert.Throws <MemberApiProxyException>( () => MemberApiProxy.GetAvailableLanguages(Guid.NewGuid())).StatusCode, Is.EqualTo(HttpStatusCode.InternalServerError)); Assert.That( Assert.Throws <MemberApiProxyException>( async() => await MemberApiProxy.RegistrationFormDataAsync(new RegistrationFormDataRequest() { BrandId = Guid.NewGuid() })).StatusCode, Is.EqualTo(HttpStatusCode.InternalServerError)); Assert.That( Assert.Throws <MemberApiProxyException>( async() => await MemberApiProxy.ArePlayersIdDocumentsValid()).StatusCode, Is.EqualTo(HttpStatusCode.InternalServerError)); ServiceLayerMockingHelper.VerifyLogginServiceWasCalledAfterInternalServerError(5); }
public void WhenITryToSendGETRequestAndLogicalServerErrorOccurs() { ServiceLayerMockingHelper.MockPlayerQueriesForHttpStatus500(Container); ServiceLayerMockingHelper.MockWalletQueriesForHttpStatus500(Container); ServiceLayerMockingHelper.MockWalletQueriesForHttpStatus500(Container); ServiceLayerMockingHelper.MockLoggingServiceForHttpStatus500(Container); ServiceLayerMockingHelper.MockBonusApiProxyForHttpStatus500(Container); }
public void WhenITryToSendGETRequestToPlayerControllerAPI(string p0) { //In order to get 200 we need to Mock the service layer in order to skip validation errors ServiceLayerMockingHelper.MockPlayerQueriesForHttpStatus200(Container); ServiceLayerMockingHelper.MockBrandQueriesForHttpStatus200(Container); ServiceLayerMockingHelper.MockWalletQueriesForHttpStatus200(Container); ServiceLayerMockingHelper.MockBonusQueriesForHttpStatus200(Container); }
public void ThenIShouldSeeStatusForNotAvailableService() { Assert.That( Assert.Throws <MemberApiProxyException>(async() => await MemberApiProxy.GetCompleteBonuses()) .StatusCode, Is.EqualTo(HttpStatusCode.InternalServerError)); Assert.That( Assert.Throws <MemberApiProxyException>(async() => await MemberApiProxy.GetBonusesWithIncompleteWagering()) .StatusCode, Is.EqualTo(HttpStatusCode.InternalServerError)); ServiceLayerMockingHelper.VerifyLogginServiceWasCalledAfterInternalServerError(2); }
public void WhenITryToSendRequestToGameControllerWithValidationErrorsInTheRequest() { ServiceLayerMockingHelper.MockGameAndOperationQueriesForHttpStatus400(Container); }
public void WhenITryToSendGETRequestToGameControllerAPI(string p0) { ServiceLayerMockingHelper.MockGameAndOperationQueriesForHttpStatus200(Container); }
public void WhenITryToSendPOSTRequestToBonusControllerAPI(string p0) { ServiceLayerMockingHelper.MockBonusApiProxyForHttpStatus201(Container); }
public void WhenITryToSendRequestToBonusControllerAndServiceIsNotAvailable() { ServiceLayerMockingHelper.MockBonusApiProxyForHttpStatus500(Container); ServiceLayerMockingHelper.MockLoggingServiceForHttpStatus500(Container); }
public void WhenITryToSendRequestWithInvalidParametersToBonusControllerAPI(string p0) { ServiceLayerMockingHelper.MockBonusApiProxyForHttpStatus400(Container); }
public void WhenITryToSendPOSTRequestToPlayerControllerEndPoint() { ServiceLayerMockingHelper.MockPlayerCommandsForHttpStatus201(Container); Assert.DoesNotThrow(async() => ScenarioContext.Current[ResponseFromPasswordChanged] = await MemberApiProxy.ChangePasswordAsync(new ChangePasswordRequest() { OldPassword = LoggedInPlayerMetadata.Password, NewPassword = TestDataGenerator.GetRandomString(), Username = LoggedInPlayerMetadata.Username })); Assert.DoesNotThrow(async() => ScenarioContext.Current[ResponseFromPersonalInfoChanged] = await MemberApiProxy.ChangePersonalInfoAsync(new ChangePersonalInfoRequest() { PlayerId = PlayerId, FirstName = TestDataGenerator.GetRandomString(), LastName = TestDataGenerator.GetRandomString(), Email = TestDataGenerator.GetRandomEmail(), CurrencyCode = "CAD", DateOfBirth = DateTime.UtcNow.AddYears(-30).ToString("yyyy/MM/dd"), Gender = "Male", Title = "Mr", CountryCode = TestDataGenerator.GetRandomCountryCode(), MailingAddressCity = TestDataGenerator.GetRandomString(), MailingAddressLine1 = TestDataGenerator.GetRandomString(), MailingAddressPostalCode = TestDataGenerator.GetRandomNumber(1000).ToString(), PhoneNumber = TestDataGenerator.GetRandomPhoneNumber(), AccountAlertEmail = false, AccountAlertSms = true, MarketingAlertEmail = true, MarketingAlertPhone = false, MarketingAlertSms = false })); Assert.DoesNotThrow(async() => ScenarioContext.Current[ResponseFromContactInfoChanged] = await MemberApiProxy.ChangeContactInfoAsync(new ChangeContactInfoRequest() { PlayerId = PlayerId, MailingAddressCity = TestDataGenerator.GetRandomString(), PhoneNumber = TestDataGenerator.GetRandomPhoneNumber(false), CountryCode = LoggedInPlayerMetadata.Country, MailingAddressLine1 = TestDataGenerator.GetRandomString(), MailingAddressPostalCode = TestDataGenerator.GetRandomNumber(1000).ToString() })); Assert.DoesNotThrow(async() => ScenarioContext.Current[ResponseFromSelfExclusion] = await MemberApiProxy.SelfExclude(new SelfExclusionRequest() { Option = (int)PlayerEnums.SelfExclusion._1Year, PlayerId = PlayerId })); Assert.DoesNotThrow(async() => ScenarioContext.Current[ResponseFromTimeOut] = await MemberApiProxy.TimeOut(new TimeOutRequest() { PlayerId = PlayerId, Option = (int)PlayerEnums.TimeOut.Month })); Assert.DoesNotThrow(async() => ScenarioContext.Current[ResponseFromChangedSecurityQuestion] = await MemberApiProxy.ChangeSecurityQuestionAsync(new ChangeSecurityQuestionRequest() { Id = PlayerId.ToString(), SecurityAnswer = TestDataGenerator.GetRandomString(), SecurityQuestionId = LoggedInPlayerMetadata.SecurityQuestion })); Assert.DoesNotThrow(async() => ScenarioContext.Current[ResponseFromMobilePhoneVerification] = await MemberApiProxy.VerificationCodeAsync(new VerificationCodeRequest())); Assert.DoesNotThrow(async() => ScenarioContext.Current[ResponseFromMobilePhoneVerified] = await MemberApiProxy.VerifyMobileAsync(new VerifyMobileRequest())); }
public void WhenITryToSendRequestWithInvalidParametersToPlayerControllerAPI(string p0) { //In order to be able to get validation errors 400 we need to mock some methods on service layer ServiceLayerMockingHelper.MockPlayerQueriesForHttpStatus400(Container); ServiceLayerMockingHelper.MockBrandQueriesForHttpStatus400(Container); }