Esempio n. 1
0
        public EventsService(
            IRepository <Account> repositoryAccount,
            IRepository <AccountSet> repositoryAccountSet,
            IRepository <EventRelationType> repositoryEventRelationType,
            IRepository <CurrencyType> repositoryCurrencyType,
            IRepository <AlgorithmType> repositoryAlgorithmType,
            IRepository <Event> repositoryEvent,
            IRepository <EventCondition> repositoryEventCondition,
            IEventsFactory eventsFactory,
            IAccountingService accountingService,
            IBetsService betsService,
            IFactory <IScopeable <IUnitOfWork> > scopeableFactory)
        {
            this._repositoryAccount           = repositoryAccount;
            this._repositoryAccountSet        = repositoryAccountSet;
            this._repositoryEventRelationType = repositoryEventRelationType;
            this._repositoryCurrencyType      = repositoryCurrencyType;
            this._repositoryAlgorithmType     = repositoryAlgorithmType;
            this._repositoryEvent             = repositoryEvent;
            this._repositoryEventCondition    = repositoryEventCondition;

            this._eventsFactory = eventsFactory;

            this._accountingService = accountingService;
            this._betsService       = betsService;

            this._scopeableFactory = scopeableFactory;
        }
Esempio n. 2
0
 public void TestInitialize()
 {
     this.betsRepository = TestObjectFactoryRepositories.GetBetsRepository();
     this.betsService    = new BetsService(this.betsRepository);
     this.bet            = new Bet()
     {
         Name = "Bet to add"
     };
 }
Esempio n. 3
0
        public DataManager(IXmlParserService xmlParserService, IMatchesService matchesService, IBetsService betsService, IOddsService oddsService)
        {
            Guard.WhenArgument(xmlParserService, nameof(xmlParserService)).IsNull().Throw();
            Guard.WhenArgument(matchesService, nameof(matchesService)).IsNull().Throw();
            Guard.WhenArgument(betsService, nameof(betsService)).IsNull().Throw();
            Guard.WhenArgument(oddsService, nameof(oddsService)).IsNull().Throw();

            this.xmlParserService = xmlParserService;
            this.matchesService   = matchesService;
            this.betsService      = betsService;
            this.oddsService      = oddsService;

            this.xmlMatches       = this.xmlParserService.GetMatches(Constants.BaseUrl).ToList();
            this.existMatchXmlIds = this.GetExistMatchXmlIds(this.xmlMatches);
        }
Esempio n. 4
0
        public BetsController()
        {
            var account = CloudConfiguration.GetStorageAccount("DataConnectionString");

            this._betsService = new BetsService(
                new AzureRepository <AzureBet, Bet>(account),
                new AzureRepository <AzureAccount, Account>(account),
                new AzureRepository <AzureEvent, Event>(account),
                new AzureRepository <AzureOutcomesType, OutcomesType>(account),
                new AzureRepository <AzureCurrencyType, CurrencyType>(account),
                new AzureRepository <AzureEventBetCondition, EventBetCondition>(account),
                new AzureRepository <AzureBetRateAlgorithm, BetRateAlgorithm>(account),
                new BetsFactory(
                    new AzureRepository <AzureBet, Bet>(account),
                    new AzureRepository <AzureEventBetCondition, EventBetCondition>(account),
                    new AzureRepository <AzureEventRelationType, EventRelationType>(account),
                    new AzureRepository <AzureCurrencyType, CurrencyType>(account),
                    new AzureRepository <AzureAlgorithmType, AlgorithmType>(account),
                    new AzureRepository <AzureAccountSetAccounts, AccountSetAccounts>(account),
                    new AzureRepository <AzureBetRateAlgorithm, BetRateAlgorithm>(account),
                    new AzureScopeableUnitOfWorkFactory()));

            this._userManager = Startup.UserManagerFactory();
        }
 public BetsController(IBetsService betsService)
 {
     _betsService = betsService;
 }