Пример #1
0
 public BetController(ILoggerFactory loggerFactory, IGameRepository gameRepository, IBetService betService)
 {
     _logger = loggerFactory.CreateLogger <BetController>();
     _logger.LogInformation("BetController initialized.");
     _gameRepository = gameRepository;
     _betService     = betService;
 }
 public BaseController(IComponentContext component)
 {
     this.component   = component;
     rouletteServices = this.component.Resolve <IRouletteService>();
     betServices      = this.component.Resolve <IBetService>();
     playerServices   = this.component.Resolve <IPlayerService>();
 }
Пример #3
0
        public CoinFlipManager
        (
            IRepoServiceFactory repoServiceFactory,
            ICoinFlipService coinFlipService,
            IJackpotDraftService draftService,
            ICoinFlipHubConnections coinFlipHubConnections,
            IBetOrWithdrawQueueManager betOrWithdrawQueueManager,
            IBetHubConnections betHubConnections,
            ILogServiceFactory logServiceFactory,
            IBetService betService,
            IMongoJackpotRepoService jackpotRepoService,
            IHotStatusManager hotStatusManager,
            IDiscordService discordService
        )
        {
            _repoServiceFactory        = repoServiceFactory;
            _coinFlipService           = coinFlipService;
            _draftService              = draftService;
            _coinFlipHubConnections    = coinFlipHubConnections;
            _betOrWithdrawQueueManager = betOrWithdrawQueueManager;
            _betHubConnections         = betHubConnections;
            _betService         = betService;
            _jackpotRepoService = jackpotRepoService;
            _hotStatusManager   = hotStatusManager;
            _discordService     = discordService;

            _logService = logServiceFactory.CreateLogger <CoinFlipManager>();
            _betQueue   = new BetQueue();

            Setup().Wait();
        }
Пример #4
0
 public CoinFlipService
 (
     IHashService hashService,
     IRandomService randomService,
     IRepoServiceFactory repoServiceFactory,
     ITransactionFactory transactionFactory,
     IBetService betService,
     IItemService itemService,
     IMongoJackpotRepoService mongoJackpotRepoService,
     ICoinFlipHubConnections coinFlipHubConnections,
     IMongoPreHashRepoService preHashRepoService,
     IDiscordService discordService
 )
 {
     _hashService             = hashService;
     _randomService           = randomService;
     _repoServiceFactory      = repoServiceFactory;
     _transactionFactory      = transactionFactory;
     _betService              = betService;
     _itemService             = itemService;
     _mongoJackpotRepoService = mongoJackpotRepoService;
     _coinFlipHubConnections  = coinFlipHubConnections;
     _preHashRepoService      = preHashRepoService;
     _discordService          = discordService;
 }
Пример #5
0
        public JackpotMatchManager
        (
            IRepoServiceFactory repoServiceFactory,
            IBetService betService,
            IHashService hashService,
            IRandomService randomService,
            IJackpotDraftService draftService,
            ILogServiceFactory logServiceFactory,
            IBetOrWithdrawQueueManager betOrWithdrawQueueManager,
            IGameModeSettingService gameModeSettingService,
            IBetHubConnections betHubConnections,
            IMatchHubConnections matchHubConnections,
            IDiscordService discordService
        ) : base(repoServiceFactory, betService, hashService, randomService)
        {
            _repoServiceFactory        = repoServiceFactory;
            _betService                = betService;
            _draftService              = draftService;
            _matchHubConnections       = matchHubConnections;
            _discordService            = discordService;
            _betHubConnections         = betHubConnections;
            _gameModeSettingService    = gameModeSettingService;
            _betOrWithdrawQueueManager = betOrWithdrawQueueManager;
            _logService                = logServiceFactory.CreateLogger <JackpotMatchManager>();

            _betQueue = new BetQueue();

            SetUpGameModeAndSetting().Wait();
        }
Пример #6
0
        private UIElement Add(string bookmakerPhoneNumber, IEnumerable <ClientDisplayModel> clients, IEnumerable <string> sports, IEnumerable <TournamentDisplayModel> tournaments, IEnumerable <EventDisplayModel> events, IEnumerable <CoefficientDisplayModel> coefficients)
        {
            BetCreateViewModel viewModel = new BetCreateViewModel(bookmakerPhoneNumber, clients, sports, tournaments, events, coefficients);
            BetCreateControl   control   = new BetCreateControl(viewModel);

            viewModel.BetCreated += (s, e) =>
            {
                BetCreateModel betCreateModel = e.Bet;
                BetCreateDTO   betCreateDTO   = Mapper.Map <BetCreateModel, BetCreateDTO>(betCreateModel);

                using (IBetService service = factory.CreateBetService())
                {
                    ServiceMessage serviceMessage = service.Create(betCreateDTO);
                    RaiseReceivedMessageEvent(serviceMessage);

                    if (serviceMessage.IsSuccessful)
                    {
                        viewModel.Sum = 0;
                        Notify();
                    }
                }
            };

            return(control);
        }
Пример #7
0
        private void Edit(BetDisplayModel betDisplayModel)
        {
            BetInfoViewModel viewModel = new BetInfoViewModel(betDisplayModel);
            BetInfoControl   control   = new BetInfoControl(viewModel);
            Window           window    = WindowFactory.CreateByContentsSize(control);

            viewModel.BetEdited += (s, e) =>
            {
                BetEditModel betEditModel = e.Bet;
                BetEditDTO   betEditDTO   = Mapper.Map <BetEditModel, BetEditDTO>(betEditModel);

                using (IBetService service = factory.CreateBetService())
                {
                    ServiceMessage serviceMessage = service.Update(betEditDTO);
                    RaiseReceivedMessageEvent(serviceMessage);

                    if (serviceMessage.IsSuccessful)
                    {
                        window.Close();
                        Notify();
                    }
                }
            };

            window.Show();
        }
 public XmlService(IBetService betService, IEventService eventService, IMatchService matchService, IOddService oddService, ISportService sportService)
 {
     this.betService   = betService;
     this.eventService = eventService;
     this.matchService = matchService;
     this.oddService   = oddService;
     this.sportService = sportService;
 }
 public NotificationsHub(ISportService sportService, IEventService eventService, IMatchService matchService, IBetService betService, IOddService oddService)//, IHubContext<NotificationsHub> hubContext)
 {
     this.sportService = sportService;
     this.eventService = eventService;
     this.matchService = matchService;
     this.betService   = betService;
     this.oddService   = oddService;
 }
 public ShowCategories(
     IGamePropertyService gamePropertyService,
     IBetService betService,
     ICategoryService categoryService)
 {
     GamePropertyService = gamePropertyService;
     BetService          = betService;
     CategoryService     = categoryService;
 }
 public LeaderboardsController(IRepository <WinnersLeagueUser> userRepository,
                               IRepository <League> leagueRepository, IBetService betService
                               , IMatchService matchService)
 {
     this.matchService     = matchService;
     this.userRepository   = userRepository;
     this.leagueRepository = leagueRepository;
     this.betService       = betService;
 }
 public BetApplication(
     IGenericService <Bet> genericService,
     IBetService betService,
     ICacheRepository cacheRepository)
     : base(genericService)
 {
     BetService      = betService;
     CacheRepository = cacheRepository;
 }
Пример #13
0
 public ShowCategory(
     IGamePropertyService gamePropertyService,
     ICategoryService categoryService,
     IBetService betService,
     IWatcheMoviesStatisticService watcheMoviesStatisticService)
 {
     GamePropertyService          = gamePropertyService;
     CategoryService              = categoryService;
     BetService                   = betService;
     WatcheMoviesStatisticService = watcheMoviesStatisticService;
 }
        public void CancelBetShouldCallRepository()
        {
            const int betId = 1;
            m_BetRepositoryMock = new Mock<IBetRepository>();
            m_BetMapperMock = new Mock<IBetMapper>();
            m_BetService = new BetService(m_BetRepositoryMock.Object, m_BetMapperMock.Object);

            m_BetService.DeleteBet(betId);

            m_BetRepositoryMock.Verify(x => x.CancelBet(betId), Times.Once);
        }
        public async Task PlaceBetShouldCallRepository()
        {
            BetDto bet = new BetDto();
            m_BetRepositoryMock = new Mock<IBetRepository>();
            m_BetMapperMock = new Mock<IBetMapper>();
            m_BetService = new BetService(m_BetRepositoryMock.Object, m_BetMapperMock.Object);

            await m_BetService.CreateBet(bet).ConfigureAwait(false);

            m_BetRepositoryMock.Verify(x => x.Persist(It.IsAny<Bet>()), Times.Once);
        }
Пример #16
0
 public BetController(SportBetsContext context,
                      IBetFinder finder,
                      IUnitOfWork unitOfWork,
                      IRepository <Bet> repository,
                      IBetService betService)
 {
     _context    = context;
     _finder     = finder;
     _unitOfWork = unitOfWork;
     _repository = repository;
     _betService = betService;
 }
Пример #17
0
 public BetsController(IRepository <Odd> oddRepository,
                       IOddService oddService,
                       IHomeService homeService,
                       IBetService betService,
                       IRepository <Bet> betRepository)
 {
     this.oddRepository = oddRepository;
     this.oddService    = oddService;
     this.homeService   = homeService;
     this.betService    = betService;
     this.betRepository = betRepository;
 }
        public void GetBetsByUserIdShouldCallRepository()
        {
            const int userId = 1;
            m_BetRepositoryMock = new Mock<IBetRepository>();
            m_BetRepositoryMock.Setup(x => x.GetBetsByUserId(userId)).Returns(new Task<IList<Bet>>(() => new List<Bet>()));
            m_BetMapperMock = new Mock<IBetMapper>();
            m_BetService = new BetService(m_BetRepositoryMock.Object, m_BetMapperMock.Object);

            m_BetService.GetBetsByUserId(userId);

            m_BetRepositoryMock.Verify(x => x.GetBetsByUserId(userId), Times.Once);
        }
Пример #19
0
        public MatchManagerTest()
        {
            _fakedRepoServiceFactory     = A.Fake <IRepoServiceFactory>();
            _fakeMatchRepoServicey       = A.Fake <IMatchRepoService>();
            _fakeHashService             = A.Fake <IHashService>();
            _fakeRandomService           = A.Fake <IRandomService>();
            _fakedMatchHub               = A.Fake <IMatchHubConnections>();
            _fakedBetHub                 = A.Fake <IBetHubConnections>();
            _fakeBetService              = A.Fake <IBetService>();
            _fakedGameModeSettingService = A.Fake <IGameModeSettingService>();

            A.CallTo(() => _fakedRepoServiceFactory.MatchRepoService).Returns(_fakeMatchRepoServicey);
        }
Пример #20
0
 protected JackpotMatchService
 (
     IRepoServiceFactory repoServiceFactory,
     IBetService betService,
     IHashService hashService,
     IRandomService randomService
 )
 {
     _matchRepoService   = repoServiceFactory.MatchRepoService;
     _repoServiceFactory = repoServiceFactory;
     _betService         = betService;
     _hashService        = hashService;
     _randomService      = randomService;
 }
Пример #21
0
        public CoinFlipServiceTest()
        {
            _fakedHashService   = A.Fake <IHashService>();
            _fakedRandomService = A.Fake <IRandomService>();
            var fakedRepoServcieFacotry = A.Fake <IRepoServiceFactory>();

            _fakedCoinFlipMatchRepoService = A.Fake <ICoinFlipMatchRepoService>();
            _fakedUserRepoService          = A.Fake <IUserRepoService>();
            _fakedGameModeRepoSerivce      = A.Fake <IGameModeRepoService>();
            _fakedTransactionFactory       = A.Fake <ITransactionFactory>();
            _fakedTransactionWrapper       = A.Fake <ITransactionWrapper>();
            _fakedBetService  = A.Fake <IBetService>();
            _fakedItemService = A.Fake <IItemService>();
            _fakedJackpotSettingRepoService = A.Fake <IJackpotSettingRepo>();
            _fakedMongoDbJackpotRepoService = A.Fake <IMongoJackpotRepoService>();
            _fakedMongoDbPreHashRepoService = A.Fake <IMongoPreHashRepoService>();

            A.CallTo(() => _fakedTransactionFactory.BeginTransaction()).Returns(_fakedTransactionWrapper);
            A.CallTo(() => fakedRepoServcieFacotry.CoinFlipMatchRepoService).Returns(_fakedCoinFlipMatchRepoService);
            A.CallTo(() => fakedRepoServcieFacotry.GameModeRepoService).Returns(_fakedGameModeRepoSerivce);
            A.CallTo(() => fakedRepoServcieFacotry.UserRepoService).Returns(_fakedUserRepoService);
            A.CallTo(() => fakedRepoServcieFacotry.JackpotSettingRepo).Returns(_fakedJackpotSettingRepoService);

            _defaultSetting = new CreateCoinFlipSettingModel
            {
                AllowCsgo = true,
                AllowPubg = false,
                Diff      = 1000,
                MaxItem   = 10,
                MinItem   = 0,
                PreHash   = "ranomdHash"
            };


            _coinFlipService = new CoinFlipService
                               (
                _fakedHashService,
                _fakedRandomService,
                fakedRepoServcieFacotry,
                _fakedTransactionFactory,
                _fakedBetService,
                _fakedItemService,
                _fakedMongoDbJackpotRepoService,
                A.Dummy <ICoinFlipHubConnections>(),
                _fakedMongoDbPreHashRepoService,
                A.Dummy <IDiscordService>()
                               );
            //TODO CHECK ALL DUMMY TEST OBJECTS!
        }
Пример #22
0
        public CoinFlipManagerTest()
        {
            _fakedRepoServiceFactory = A.Fake <IRepoServiceFactory>();

            _fakedCoinFlipMatchRepoService = A.Fake <ICoinFlipMatchRepoService>();
            _fakedBetRepoService           = A.Fake <IBetRepoService>();
            _fakedJackpotSettingRepo       = A.Fake <IJackpotSettingRepo>();
            _fakedGameModeRepoService      = A.Fake <IGameModeRepoService>();
            _fakedUserRepoService          = A.Fake <IUserRepoService>();

            _fakedCoinFlipService = A.Fake <ICoinFlipService>();

            _fakedDraftingService = A.Fake <IJackpotDraftService>();

            _gameMode = new DatabaseModel.GameMode
            {
                CurrentSettingId = 1,
                Id        = 2,
                IsEnabled = true,
                Type      = "CoinFlip"
            };

            _coinFlipSocketSender = A.Dummy <ICoinFlipHubConnections>();

            A.CallTo(() => _fakedRepoServiceFactory.UserRepoService).Returns(_fakedUserRepoService);
            A.CallTo(() => _fakedRepoServiceFactory.CoinFlipMatchRepoService).Returns(_fakedCoinFlipMatchRepoService);
            A.CallTo(() => _fakedRepoServiceFactory.BetRepoService).Returns(_fakedBetRepoService);
            A.CallTo(() => _fakedRepoServiceFactory.JackpotSettingRepo).Returns(_fakedJackpotSettingRepo);
            A.CallTo(() => _fakedRepoServiceFactory.GameModeRepoService).Returns(_fakedGameModeRepoService);

            A.CallTo(() => _fakedGameModeRepoService.Find(GameModeHelper.GetStringFromType(GameModeType.CoinFlip))).Returns(_gameMode);

            _dummyBetOrWithdrawQueueManager = A.Dummy <IBetOrWithdrawQueueManager>();
            _dummyBetHubConnection          = A.Dummy <IBetHubConnections>();
            _dummyBetService              = A.Dummy <IBetService>();
            _dummyLogServiceFactory       = A.Dummy <ILogServiceFactory>();
            _dummyMongoJackpotRepoService = A.Dummy <IMongoJackpotRepoService>();
            _dummyHotStatusManager        = A.Dummy <IHotStatusManager>();
            _dummyDiscordService          = A.Dummy <IDiscordService>();
        }
Пример #23
0
        public override IEnumerable <BetDisplayModel> GetAll()
        {
            IEnumerable <BetDisplayModel> betModels = null;

            using (IBetService service = factory.CreateBetService())
            {
                DataServiceMessage <IEnumerable <BetDisplayDTO> > serviceMessage = service.GetAll();

                RaiseReveivedMessageEvent(serviceMessage.IsSuccessful, serviceMessage.Message);
                if (serviceMessage.IsSuccessful)
                {
                    IEnumerable <BetDisplayDTO> betDTOs = serviceMessage.Data;
                    betModels = betDTOs.Select(betDTO => Mapper.Map <BetDisplayDTO, BetDisplayModel>(betDTO));
                }
                else
                {
                    betModels = new List <BetDisplayModel>();
                }
            }

            return(betModels);
        }
Пример #24
0
 public BettyController(ILogger <BettyController> logger, IBetService service)
 {
     _logger  = logger;
     _service = service;
 }
 public BetsGroupController(IBetService betService, UserManager <User> userManager)
 {
     this.betService  = betService;
     this.userManager = userManager;
 }
Пример #26
0
 public UserController(IUserService userService, IBetService betService, IMapper mapper)
 {
     _userService = userService;
     _betService  = betService;
     _mapper      = mapper;
 }
Пример #27
0
 public HomeController(IHomeService homeService, IBetService betService)
 {
     this.homeService = homeService;
     this.betService  = betService;
 }
 public BetController(IBetService BetService)
 {
     _BetService = BetService;
 }
 public BetsController(IBetService betService, IMapper mapper)
 {
     this.betService = betService;
     this.mapper = mapper;
 }
Пример #30
0
 public BetController(IBetService betService)
 {
     m_BetService = betService;
 }
 public HomeController(IBetService betService, IBetAnalyticService analyticService, IEnumerable<IRiskyBetDetector> riskyDetectors)
 {
     _betService = betService;
     _analyticService = analyticService;
     _riskyDetectors = riskyDetectors;
 }
Пример #32
0
 public Leaderboard(IBetService betService)
 {
     BetService = betService;
 }
Пример #33
0
 public ChartService(IBetService betService)
 {
     _betService = betService;
 }
 public CustomerService(IBetService betService, CustomerRiskProfile customerRiskProfile)
 {
     _betService = betService;
     _customerRiskProfile = customerRiskProfile;
 }
Пример #35
0
 public UsuarioService(IUsuarioRepository usuarioRepository, HelpDeskContext context, IBetService betService)
 {
     _usuarioRepository = usuarioRepository;
     _context           = context;
     _betService        = betService;
 }
Пример #36
0
 public HomeController(IBetService betService, IBetAnalyticService analyticService, IEnumerable <IRiskyBetDetector> riskyDetectors)
 {
     _betService      = betService;
     _analyticService = analyticService;
     _riskyDetectors  = riskyDetectors;
 }
Пример #37
0
 public BetController(IBetService betService)
 {
     _betService = betService;
 }
Пример #38
0
 public BetController()
 {
     _service = new BetService();
 }
 public BetsController(IBetService betService)
 {
     _betService = betService;
 }