Beispiel #1
0
        public BetLevel CreateBetLevel(GameServer gameServer, Brand brand)
        {
            var betLevel = new BetLevel
            {
                Id           = Guid.NewGuid(),
                GameServerId = gameServer.Id,
                BrandId      = brand.Id,
                Code         = new Random().Next(100000).ToString(),
            };

            _gsiRepository.BetLimits.Add(betLevel);
            return(betLevel);
        }
Beispiel #2
0
        private void CreateWallet(Brand brand)
        {
            var walletTemplate = new WalletTemplate()
            {
                Brand       = brand,
                Name        = "Main Wallet",
                Id          = Guid.NewGuid(),
                IsMain      = true,
                CreatedBy   = _sharedData.User.UserId,
                DateCreated = DateTimeOffset.UtcNow
            };

            brand.WalletTemplates.Add(walletTemplate);
            _brandRepository.WalletTemplates.Add(walletTemplate);
            _brandRepository.SaveChanges();
        }
Beispiel #3
0
        public PaymentLevel CreatePaymentLevel(
            Brand brand,
            Currency currency)
        {
            var paymentLevelCode = TestDataGenerator.GetRandomString(3);
            var paymentLevel     = new PaymentLevel
            {
                Id                   = Guid.NewGuid(),
                BrandId              = brand.Id,
                CurrencyCode         = currency.Code,
                CreatedBy            = _sharedData.User.UserName,
                DateCreated          = DateTimeOffset.Now,
                Code                 = "PL-" + paymentLevelCode,
                Name                 = "PaymentLevel-" + paymentLevelCode,
                EnableOfflineDeposit = true,
                IsDefault            = true
            };

            _paymentRepository.PaymentLevels.Add(paymentLevel);
            return(paymentLevel);
        }
Beispiel #4
0
        public VipLevel CreateVipLevel(Brand brand, int limitCount = 0)
        {
            var vipLevelName = TestDataGenerator.GetRandomString();
            int rank;

            do
            {
                rank = TestDataGenerator.GetRandomNumber(100);
            } while (_brandRepository.VipLevels.Any(vl => vl.Rank == rank));
            var limits = new List <VipLevelLimitViewModel>();

            for (var i = 0; i < limitCount; i++)
            {
                var gameServer = CreateGameServer();
                var betLimit   = CreateBetLevel(gameServer, brand);
                limits.Add(new VipLevelLimitViewModel
                {
                    Id           = Guid.NewGuid(),
                    CurrencyCode = brand.DefaultCurrency,
                    GameServerId = gameServer.Id,
                    BetLimitId   = betLimit.Id
                });
            }
            var newVipLevel = new VipLevelViewModel
            {
                Id        = Guid.NewGuid(),
                Name      = vipLevelName,
                Code      = vipLevelName.Remove(3),
                Brand     = brand.Id,
                Rank      = rank,
                IsDefault = _brandRepository.VipLevels.All(vl => !vl.IsDefault),
                Limits    = limits
            };

            _brandCommands.AddVipLevel(newVipLevel, _sharedData.User.UserName);
            var vipLevel = _brandQueries.GetAllVipLevels().Single(x => x.Code == newVipLevel.Code);

            return(vipLevel);
        }