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 ThenVipLevelIsSuccessfullyChanged()
        {
            ScenarioContext.Current.Should().ContainKey("playerId");
            ScenarioContext.Current.Should().ContainKey("vipLevelId");
            var playerId   = ScenarioContext.Current.Get <Guid>("playerId");
            var vipLevelId = ScenarioContext.Current.Get <Guid>("vipLevelId");

            var data = new ChangeVipLevelData
            {
                NewVipLevel = vipLevelId,
                PlayerId    = playerId,
                Remarks     = TestDataGenerator.GetRandomString()
            };

            var result = AdminApiProxy.ChangeVipLevelInPlayerManager(data);

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