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)); }
public void ThenPaymentLevelIsSuccessfullyChanged() { ScenarioContext.Current.Should().ContainKey("playerId"); ScenarioContext.Current.Should().ContainKey("paymentLevelId"); var playerId = ScenarioContext.Current.Get <Guid>("playerId"); var paymentLevelId = ScenarioContext.Current.Get <Guid>("paymentLevelId"); var data = new ChangePaymentLevelData { PaymentLevelId = paymentLevelId, PlayerId = playerId, Remarks = TestDataGenerator.GetRandomString() }; var result = AdminApiProxy.ChangePaymnetLevelInPlayerManager(data); result.Should().NotBeNull(); result.StatusCode.ShouldBeEquivalentTo(HttpStatusCode.OK); }