Ejemplo n.º 1
0
        public void ThenICanNotExecuteProtectedPlayerMethodsWithInsufficientPermissions()
        {
            LogWithNewUser(Modules.AdminActivityLog, Permissions.View);

            const int statusCode = (int)HttpStatusCode.Forbidden;

            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.ChangeVipLevelInPlayerManager(new ChangeVipLevelData())).GetHttpCode(), Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.ChangePaymnetLevelInPlayerManager(new ChangePaymentLevelData())).GetHttpCode(), Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.ChangePlayersPaymentLevelInPlayerManager(new ChangePlayersPaymentLevelData())).GetHttpCode(), Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.AddPlayerInPlayerManager(new AddPlayerData())).GetHttpCode(), Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.GetBankAccountInPlayerManager(new Guid())).GetHttpCode(), Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.SaveBankAccountInPlayerManager(new EditPlayerBankAccountData())).GetHttpCode(), Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.SetCurrentBankAccountInPlayerManager(new SetCurrentPlayerBankAccountData())).GetHttpCode(), Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.EditPlayerInfo(new EditPlayerData())).GetHttpCode(), Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.SubmitExemptionInPlayerInfo(new Exemption())).GetHttpCode(), Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <HttpException>(() => AdminApiProxy.SetStatusInPlayerInfo(new SetStatusData())).GetHttpCode(), Is.EqualTo(statusCode));
        }
Ejemplo n.º 2
0
        public void ThenPlayersPaymentLevelIsSuccessfullyChanged()
        {
            ScenarioContext.Current.Should().ContainKey("playerId");
            ScenarioContext.Current.Should().ContainKey("paymentLevelId");
            var playerId       = ScenarioContext.Current.Get <Guid>("playerId");
            var playerId2      = ScenarioContext.Current.Get <Guid>("playerId2");
            var playerId3      = ScenarioContext.Current.Get <Guid>("playerId3");
            var paymentLevelId = ScenarioContext.Current.Get <Guid>("paymentLevelId");

            Guid[] playerIds = new Guid[3] {
                playerId, playerId2, playerId3
            };
            var data = new ChangePlayersPaymentLevelData
            {
                PaymentLevelId = paymentLevelId,
                PlayerIds      = playerIds,
                Remarks        = TestDataGenerator.GetRandomString()
            };

            var result = AdminApiProxy.ChangePlayersPaymentLevelInPlayerManager(data);

            result.Should().NotBeNull();
            result.StatusCode.ShouldBeEquivalentTo(HttpStatusCode.OK);
        }