Пример #1
0
        public void ThenNewPlayerIsCreated()
        {
            var data          = TestDataGenerator.CreateRandomRegistrationData();
            var addPlayerData = Mapper.DynamicMap <AddPlayerData>(data);

            addPlayerData.Brand    = data.BrandId;
            addPlayerData.Country  = data.CountryCode;
            addPlayerData.Culture  = data.CultureCode;
            addPlayerData.Currency = "CAD";

            var result = AdminApiProxy.AddPlayerInPlayerManager(addPlayerData);

            result.Should().NotBeNull();
            result.StatusCode.ShouldBeEquivalentTo(HttpStatusCode.OK);
        }
Пример #2
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));
        }