Example #1
0
        public void ThenAsAResponseIShouldSeeStatusCodeBadRequest(int p0)
        {
            Assert.Throws <MemberApiValidationException>(async() => await MemberApiProxy.ProfileAsync());
            Assert.Throws <MemberApiValidationException>(
                async() => await MemberApiProxy.GetOnSiteMessageAsync(new OnSiteMessageRequest()
            {
                OnSiteMessageId = Guid.NewGuid()
            }));
            Assert.Throws <MemberApiValidationException>(
                async() => await MemberApiProxy.GetWalletsAsync(Guid.NewGuid()));

            Assert.Throws <MemberApiValidationException>(
                async() => await MemberApiProxy.GetPlayerData(TestDataGenerator.GetRandomString()));

            //Test anonymous requests
            SetInvalidToken();

            Assert.Throws <MemberApiValidationException>(
                async() => await MemberApiProxy.GetSecurityQuestionAsync(Guid.NewGuid()));

            Assert.Throws <MemberApiValidationException>(
                async() => await MemberApiProxy.GetAcknowledgementDataAsync(Guid.NewGuid()));

            Assert.Throws <MemberApiValidationException>(
                async() => await MemberApiProxy.GetPlayerByResetPasswordToken(TestDataGenerator.GetRandomString()));
        }
        public async Task <IHttpActionResult> GetOfflineDeposit(Guid id)
        {
            var deposit = await _memberApiProxy.GetOfflineDeposit(id);

            var playerName = HttpContext.Current.User.Identity.Name;
            var playerData = await _memberApiProxy.GetPlayerData(playerName);

            return(Ok(new
            {
                Deposit = deposit,
                Player = playerData
            }));
        }
Example #3
0
        public void WhenITryToSendGETRequestToPlayerControllerEndPoint()
        {
            ErrorMessagesFromUnauthorizedCalls.Add(Assert.Throws <MemberApiProxyException>(
                                                       async() => await MemberApiProxy.ProfileAsync()).Exception.ErrorMessage);

            ErrorMessagesFromUnauthorizedCalls.Add(Assert.Throws <MemberApiProxyException>(
                                                       async() => await MemberApiProxy.SecurityQuestionsAsync()).Exception.ErrorMessage);

            ErrorMessagesFromUnauthorizedCalls.Add(Assert.Throws <MemberApiProxyException>(
                                                       async() => await MemberApiProxy.GetOnSiteMessagesCountAsync()).Exception.ErrorMessage);

            ErrorMessagesFromUnauthorizedCalls.Add(Assert.Throws <MemberApiProxyException>(
                                                       async() => await MemberApiProxy.GetBalancesSetAsync()).Exception.ErrorMessage);

            ErrorMessagesFromUnauthorizedCalls.Add(Assert.Throws <MemberApiProxyException>(
                                                       async() => await MemberApiProxy.GetWalletsAsync(Guid.NewGuid())).Exception.ErrorMessage);

            ErrorMessagesFromUnauthorizedCalls.Add(Assert.Throws <MemberApiProxyException>(
                                                       async() => await MemberApiProxy.GetPlayerData(TestDataGenerator.GetRandomString())).Exception.ErrorMessage);

            ErrorMessagesFromUnauthorizedCalls.Add(Assert.Throws <MemberApiProxyException>(
                                                       async() => await MemberApiProxy.ArePlayersIdDocumentsValid()).Exception.ErrorMessage);
        }
Example #4
0
        public void ThenIShouldSeeStatusCodeSuccessfulForEach(int p0, string p1)
        {
            Assert.DoesNotThrow(async() => await MemberApiProxy.ProfileAsync());
            Assert.DoesNotThrow(async() => await MemberApiProxy.SecurityQuestionsAsync());
            Assert.DoesNotThrow(async() => await MemberApiProxy.GetBalancesSetAsync());
            Assert.DoesNotThrow(async() => await MemberApiProxy.GetAcknowledgementDataAsync(Guid.NewGuid()));
            Assert.DoesNotThrow(
                async() =>
                await
                MemberApiProxy.GetOnSiteMessageAsync(new OnSiteMessageRequest()
            {
                OnSiteMessageId = Guid.NewGuid()
            }));
            Assert.DoesNotThrow(async() => await MemberApiProxy.GetOnSiteMessagesAsync());
            Assert.DoesNotThrow(async() => await MemberApiProxy.GetOnSiteMessagesCountAsync());

            Assert.DoesNotThrow(async() => await MemberApiProxy.GetWalletsAsync(Guid.NewGuid()));
            Assert.DoesNotThrow(async() => await MemberApiProxy.GetPlayerData(TestDataGenerator.GetRandomString()));
            Assert.DoesNotThrow(async() => await MemberApiProxy.ArePlayersIdDocumentsValid());

            //Test anonymous requests
            SetInvalidToken();
            Assert.DoesNotThrow(async() => await MemberApiProxy.GetSecurityQuestionAsync(Guid.NewGuid()));

            Assert.DoesNotThrow(
                async() =>
                await
                MemberApiProxy.RegistrationFormDataAsync(new RegistrationFormDataRequest()
            {
                BrandId = Guid.NewGuid()
            }));

            Assert.DoesNotThrow(() => MemberApiProxy.GetAvailableLanguages(Guid.NewGuid()));
            Assert.DoesNotThrow(async() => await MemberApiProxy.GetAcknowledgementDataAsync(Guid.NewGuid()));
            Assert.DoesNotThrow(async() => await MemberApiProxy.GetPlayerByResetPasswordToken(Token));
        }