Example #1
0
        public void Init()
        {
            _timer             = new TestTimer(false);
            _eventMemoryCache  = new MemoryCache("EventCache");
            _profileCache      = new MemoryCache("ProfileCache");
            _statusMemoryCache = new MemoryCache("StatusCache");

            _cacheManager      = new CacheManager();
            _dataRouterManager = new TestDataRouterManager(_cacheManager);

            var sportEventCacheItemFactory = new SportEventCacheItemFactory(_dataRouterManager, new SemaphorePool(5), TestData.Culture, new MemoryCache("FixtureTimestampCache"));
            var profileCache = new ProfileCache(_profileCache, _dataRouterManager, _cacheManager);

            SportEventCache = new SportEventCache(_eventMemoryCache, _dataRouterManager, sportEventCacheItemFactory, _timer, TestData.Cultures3, _cacheManager);
            SportDataCache  = new SportDataCache(_dataRouterManager, _timer, TestData.Cultures3, SportEventCache, _cacheManager);

            var sportEventStatusCache   = new TestLocalizedNamedValueCache();
            var namedValuesProviderMock = new Mock <INamedValuesProvider>();

            namedValuesProviderMock.Setup(args => args.MatchStatuses).Returns(sportEventStatusCache);

            EventStatusCache = new SportEventStatusCache(_statusMemoryCache, new SportEventStatusMapperFactory(), SportEventCache, _cacheManager, TimeSpan.Zero);

            SportEntityFactory = new SportEntityFactory(SportDataCache, SportEventCache, EventStatusCache, sportEventStatusCache, profileCache, SdkInfo.SoccerSportUrns);
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SportDataProvider"/> class
        /// </summary>
        /// <param name="sportEntityFactory">A <see cref="ISportEntityFactory"/> used to construct <see cref="ITournament"/> instances</param>
        /// <param name="sportEventCache">A <see cref="ISportEventCache"/> used to retrieve schedules for sport events</param>
        /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve status for sport event</param>
        /// <param name="profileCache">A <see cref="IProfileCache"/> ued to retrieve competitor or player profile</param>
        /// <param name="defaultCultures"> A <see cref="IList{CultureInfo}"/> specified as default cultures (from configuration)</param>
        /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying enum member specifying how instances provided by the current provider will handle exceptions</param>
        /// <param name="cacheManager">A <see cref="ICacheManager"/> used to interact among caches</param>
        /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param>
        public SportDataProvider(ISportEntityFactory sportEntityFactory,
                                 ISportEventCache sportEventCache,
                                 ISportEventStatusCache sportEventStatusCache,
                                 IProfileCache profileCache,
                                 IEnumerable <CultureInfo> defaultCultures,
                                 ExceptionHandlingStrategy exceptionStrategy,
                                 ICacheManager cacheManager,
                                 ILocalizedNamedValueCache matchStatusCache,
                                 IDataRouterManager dataRouterManager)
        {
            Contract.Requires(sportEntityFactory != null);
            Contract.Requires(sportEventCache != null);
            Contract.Requires(profileCache != null);
            Contract.Requires(defaultCultures != null);
            Contract.Requires(defaultCultures.Any());
            Contract.Requires(cacheManager != null);
            Contract.Requires(matchStatusCache != null);
            Contract.Requires(dataRouterManager != null);

            _sportEntityFactory    = sportEntityFactory;
            _sportEventCache       = sportEventCache;
            _sportEventStatusCache = sportEventStatusCache;
            _profileCache          = profileCache;
            _defaultCultures       = defaultCultures as IReadOnlyCollection <CultureInfo>;
            _exceptionStrategy     = exceptionStrategy;
            _cacheManager          = cacheManager;
            _matchStatusCache      = matchStatusCache;
            _dataRouterManager     = dataRouterManager;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SportDataProvider"/> class
        /// </summary>
        /// <param name="sportEntityFactory">A <see cref="ISportEntityFactory"/> used to construct <see cref="ITournament"/> instances</param>
        /// <param name="sportEventCache">A <see cref="ISportEventCache"/> used to retrieve schedules for sport events</param>
        /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve status for sport event</param>
        /// <param name="profileCache">A <see cref="IProfileCache"/> used to retrieve competitor or player profile</param>
        /// <param name="sportDataCache">A <see cref="ISportDataCache"/> used to retrieve sport data</param>
        /// <param name="defaultCultures"> A <see cref="IList{CultureInfo}"/> specified as default cultures (from configuration)</param>
        /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying enum member specifying how instances provided by the current provider will handle exceptions</param>
        /// <param name="cacheManager">A <see cref="ICacheManager"/> used to interact among caches</param>
        /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param>
        /// <param name="dataRouterManager">A <see cref="IDataRouterManager"/> used to invoke API requests</param>
        public SportDataProvider(ISportEntityFactory sportEntityFactory,
                                 ISportEventCache sportEventCache,
                                 ISportEventStatusCache sportEventStatusCache,
                                 IProfileCache profileCache,
                                 ISportDataCache sportDataCache,
                                 IEnumerable <CultureInfo> defaultCultures,
                                 ExceptionHandlingStrategy exceptionStrategy,
                                 ICacheManager cacheManager,
                                 ILocalizedNamedValueCache matchStatusCache,
                                 IDataRouterManager dataRouterManager)
        {
            Guard.Argument(sportEntityFactory, nameof(sportEntityFactory)).NotNull();
            Guard.Argument(sportEventCache, nameof(sportEventCache)).NotNull();
            Guard.Argument(profileCache, nameof(profileCache)).NotNull();
            Guard.Argument(defaultCultures, nameof(defaultCultures)).NotNull().NotEmpty();
            Guard.Argument(cacheManager, nameof(cacheManager)).NotNull();
            Guard.Argument(matchStatusCache, nameof(matchStatusCache)).NotNull();
            Guard.Argument(dataRouterManager, nameof(dataRouterManager)).NotNull();

            _sportEntityFactory    = sportEntityFactory;
            _sportEventCache       = sportEventCache;
            _sportEventStatusCache = sportEventStatusCache;
            _profileCache          = profileCache;
            _sportDataCache        = sportDataCache;
            _defaultCultures       = defaultCultures as IReadOnlyCollection <CultureInfo>;
            _exceptionStrategy     = exceptionStrategy;
            _cacheManager          = cacheManager;
            _matchStatusCache      = matchStatusCache;
            _dataRouterManager     = dataRouterManager;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NameProvider"/> class
        /// </summary>
        /// <param name="marketCacheProvider">A <see cref="IMarketCacheProvider"/> instance used to retrieve market descriptors</param>
        /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache"/> instance used to retrieve event status data</param>
        /// <param name="sportEvent">A <see cref="ISportEvent"/> instance representing associated sport @event</param>
        /// <param name="marketId">A market identifier of the market associated with the constructed instance</param>
        /// <param name="specifiers">A <see cref="IReadOnlyDictionary{String, String}"/> representing specifiers of the associated market</param>
        /// <param name="producer">An <see cref="IProducer"/> used to get market/outcome mappings</param>
        /// <param name="sportId">A sportId used to get market/outcome mappings</param>
        /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> describing the mode in which the SDK is running</param>
        /// <param name="producerManager">The <see cref="IProducerManager"/> used get available <see cref="IProducer"/></param>
        internal MarketMappingProvider(IMarketCacheProvider marketCacheProvider,
                                       ISportEventStatusCache eventStatusCache,
                                       ISportEvent sportEvent,
                                       int marketId,
                                       IReadOnlyDictionary <string, string> specifiers,
                                       IProducer producer,
                                       URN sportId,
                                       ExceptionHandlingStrategy exceptionStrategy,
                                       IProducerManager producerManager)
        {
            Guard.Argument(marketCacheProvider, nameof(marketCacheProvider)).NotNull();
            Guard.Argument(sportEvent, nameof(sportEvent)).NotNull();
            Guard.Argument(eventStatusCache, nameof(eventStatusCache)).NotNull();
            Guard.Argument(producerManager, nameof(producerManager)).NotNull();

            _marketCacheProvider = marketCacheProvider;
            _eventStatusCache    = eventStatusCache;
            _sportEvent          = sportEvent;
            _marketId            = marketId;
            _specifiers          = specifiers;
            _exceptionStrategy   = exceptionStrategy;
            _producerManager     = producerManager;
            _producer            = producer;
            _sportId             = sportId;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="NameProvider" /> class
        /// </summary>
        /// <param name="marketCacheProvider">A <see cref="IMarketCacheProvider" /> instance used to retrieve market descriptors</param>
        /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache" /> instance used to retrieve event status data</param>
        /// <param name="sportEvent">A <see cref="ISportEvent" /> instance representing associated sport @event</param>
        /// <param name="marketId">A market identifier of the market associated with the constructed instance</param>
        /// <param name="specifiers">
        ///     A <see cref="IReadOnlyDictionary{String, String}" /> representing specifiers of the associated
        ///     market
        /// </param>
        /// <param name="producer">An <see cref="IProducer" /> used to get market/outcome mappings</param>
        /// <param name="sportId">A sportId used to get market/outcome mappings</param>
        /// <param name="exceptionStrategy">
        ///     A <see cref="ExceptionHandlingStrategy" /> describing the mode in which the SDK is
        ///     running
        /// </param>
        /// <param name="producerManager">The <see cref="IProducerManager" /> used get available <see cref="IProducer" /></param>
        internal MarketMappingProvider(IMarketCacheProvider marketCacheProvider,
                                       ISportEventStatusCache eventStatusCache,
                                       ISportEvent sportEvent,
                                       int marketId,
                                       IReadOnlyDictionary <string, string> specifiers,
                                       IProducer producer,
                                       URN sportId,
                                       ExceptionHandlingStrategy exceptionStrategy,
                                       IProducerManager producerManager)
        {
            Contract.Requires(marketCacheProvider != null);
            Contract.Requires(sportEvent != null);
            Contract.Requires(eventStatusCache != null);
            Contract.Requires(producerManager != null);

            _marketCacheProvider = marketCacheProvider;
            _eventStatusCache    = eventStatusCache;
            _sportEvent          = sportEvent;
            _marketId            = marketId;
            _specifiers          = specifiers;
            _exceptionStrategy   = exceptionStrategy;
            _producerManager     = producerManager;
            _producer            = producer;
            _sportId             = sportId;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NameProviderFactory"/> class.
        /// </summary>
        /// <param name="marketCacheProvider">A <see cref="IMarketCacheProvider"/> instance used to retrieve market descriptors</param>
        /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache"/> instance used to retrieve event status data</param>
        /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> specifying how to handle potential exceptions thrown to the user code</param>
        public MarketMappingProviderFactory(IMarketCacheProvider marketCacheProvider, ISportEventStatusCache eventStatusCache, ExceptionHandlingStrategy exceptionStrategy)
        {
            Guard.Argument(marketCacheProvider, nameof(marketCacheProvider)).NotNull();
            Guard.Argument(eventStatusCache, nameof(eventStatusCache)).NotNull();

            _marketCacheProvider = marketCacheProvider;
            _eventStatusCache    = eventStatusCache;
            _exceptionStrategy   = exceptionStrategy;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NameProviderFactory"/> class.
        /// </summary>
        /// <param name="marketCacheProvider">A <see cref="IMarketCacheProvider"/> instance used to retrieve market descriptors</param>
        /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache"/> instance used to retrieve event status data</param>
        /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> specifying how to handle potential exceptions thrown to the user code</param>
        /// <param name="producerManager">An <see cref="IProducerManager"/> used to get <see cref="IProducer"/></param>
        public MarketMappingProviderFactory(IMarketCacheProvider marketCacheProvider, ISportEventStatusCache eventStatusCache, ExceptionHandlingStrategy exceptionStrategy, IProducerManager producerManager)
        {
            Contract.Requires(marketCacheProvider != null);
            Contract.Requires(eventStatusCache != null);
            Contract.Requires(producerManager != null);

            _marketCacheProvider = marketCacheProvider;
            _eventStatusCache    = eventStatusCache;
            _exceptionStrategy   = exceptionStrategy;
            _producerManager     = producerManager;
        }
 public SoccerEvent(URN id,
                    URN sportId,
                    ISportEntityFactory sportEntityFactory,
                    ISportEventCache sportEventCache,
                    ISportEventStatusCache sportEventStatusCache,
                    ILocalizedNamedValueCache matchStatusCache,
                    IEnumerable <CultureInfo> cultures,
                    ExceptionHandlingStrategy exceptionStrategy)
     : base(id, sportId, sportEntityFactory, sportEventCache, sportEventStatusCache, matchStatusCache, cultures, exceptionStrategy)
 {
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Match"/> class.
 /// </summary>
 /// <param name="id">A <see cref="URN"/> uniquely identifying the match associated with the current instance</param>
 /// <param name="sportId">A <see cref="URN"/> uniquely identifying the sport associated with the current instance</param>
 /// <param name="sportEntityFactory">A <see cref="ISportEntityFactory"/> instance used to construct <see cref="ITournament"/> instances</param>
 /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instances containing cache data associated with the current instance</param>
 /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> instance containing cache data information about the progress of a match associated with the current instance</param>
 /// <param name="matchStatusCache">A localized match statuses cache</param>
 /// <param name="cultures">A <see cref="IEnumerable{CultureInfo}"/> specifying languages the current instance supports</param>
 /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying how the initialized instance will handle potential exceptions</param>
 public Match(URN id,
             URN sportId,
             ISportEntityFactory sportEntityFactory,
             ISportEventCache sportEventCache,
             ISportEventStatusCache sportEventStatusCache,
             ILocalizedNamedValueCache matchStatusCache,
             IEnumerable<CultureInfo> cultures,
             ExceptionHandlingStrategy exceptionStrategy)
     : base(ExecutionLogPrivate, id, sportId, sportEntityFactory, sportEventStatusCache, sportEventCache, cultures, exceptionStrategy, matchStatusCache)
 {
     _sportEntityFactory = sportEntityFactory;
 }
        public TestSportEntityFactory(ISportDataCache sportDataCache             = null,
                                      ISportEventCache sportEventCache           = null,
                                      ISportEventStatusCache eventStatusCache    = null,
                                      ILocalizedNamedValueCache matchStatusCache = null,
                                      IProfileCache profileCache = null,
                                      IReadOnlyCollection <URN> soccerSportUrns = null)
        {
            _cacheManager = new CacheManager();
            var profileMemoryCache = new MemoryCache("ProfileCache");

            _sportDataCache   = sportDataCache;
            _sportEventCache  = sportEventCache;
            _eventStatusCache = eventStatusCache;
            _matchStatusCache = matchStatusCache;
            _profileCache     = profileCache ?? new ProfileCache(profileMemoryCache, new TestDataRouterManager(_cacheManager), _cacheManager);
            _soccerSportUrns  = soccerSportUrns ?? SdkInfo.SoccerSportUrns;
        }
Example #11
0
        public Stage(URN id,
                     URN sportId,
                     ISportEntityFactory sportEntityFactory,
                     ISportEventCache sportEventCache,
                     ISportDataCache sportDataCache,
                     ISportEventStatusCache sportEventStatusCache,
                     ILocalizedNamedValueCache matchStatusesCache,
                     IEnumerable <CultureInfo> cultures,
                     ExceptionHandlingStrategy exceptionStrategy)
            : base(ExecutionLogPrivate, id, sportId, sportEntityFactory, sportEventStatusCache, sportEventCache, cultures, exceptionStrategy, matchStatusesCache)
        {
            Guard.Argument(sportDataCache, nameof(sportDataCache)).NotNull();
            Guard.Argument(matchStatusesCache, nameof(matchStatusesCache)).NotNull();

            _sportEntityFactory = sportEntityFactory;
            _sportDataCache     = sportDataCache;
        }
Example #12
0
        public Stage(URN id,
                     URN sportId,
                     ISportEntityFactory sportEntityFactory,
                     ISportEventCache sportEventCache,
                     ISportDataCache sportDataCache,
                     ISportEventStatusCache sportEventStatusCache,
                     ILocalizedNamedValueCache matchStatusesCache,
                     IEnumerable <CultureInfo> cultures,
                     ExceptionHandlingStrategy exceptionStrategy)
            : base(ExecutionLogPrivate, id, sportId, sportEntityFactory, sportEventStatusCache, sportEventCache, cultures, exceptionStrategy, matchStatusesCache)
        {
            Contract.Requires(sportDataCache != null);
            Contract.Requires(matchStatusesCache != null);

            _sportEntityFactory = sportEntityFactory;
            _sportDataCache     = sportDataCache;
            _matchStatusesCache = matchStatusesCache;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SportEntityFactory"/> class
        /// </summary>
        /// <param name="sportDataCache">A <see cref="ISportDataCache"/> instance used to retrieve sport related info</param>
        /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance used to retrieve sport events</param>
        /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve statuses of sport events</param>
        /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param>
        /// <param name="profileCache">A <see cref="IProfileCache"/> used to retrieve player profiles</param>
        public SportEntityFactory(
            ISportDataCache sportDataCache,
            ISportEventCache sportEventCache,
            ISportEventStatusCache eventStatusCache,
            ILocalizedNamedValueCache matchStatusCache,
            IProfileCache profileCache)
        {
            Guard.Argument(sportDataCache, nameof(sportDataCache)).NotNull();
            Guard.Argument(sportEventCache, nameof(sportEventCache)).NotNull();
            Guard.Argument(eventStatusCache, nameof(eventStatusCache)).NotNull();
            Guard.Argument(matchStatusCache, nameof(matchStatusCache)).NotNull();
            Guard.Argument(profileCache, nameof(profileCache)).NotNull();

            _sportDataCache   = sportDataCache;
            _sportEventCache  = sportEventCache;
            _eventStatusCache = eventStatusCache;
            _matchStatusCache = matchStatusCache;
            _profileCache     = profileCache;
        }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SportEntityFactory"/> class
        /// </summary>
        /// <param name="sportDataCache">A <see cref="ISportDataCache"/> instance used to retrieve sport related info</param>
        /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance used to retrieve sport events</param>
        /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve statuses of sport events</param>
        /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param>
        /// <param name="profileCache">A <see cref="IProfileCache"/> used to retrieve player profiles</param>
        public SportEntityFactory(
            ISportDataCache sportDataCache,
            ISportEventCache sportEventCache,
            ISportEventStatusCache eventStatusCache,
            ILocalizedNamedValueCache matchStatusCache,
            IProfileCache profileCache)
        {
            Contract.Requires(sportDataCache != null);
            Contract.Requires(sportEventCache != null);
            Contract.Requires(eventStatusCache != null);
            Contract.Requires(matchStatusCache != null);
            Contract.Requires(profileCache != null);

            _sportDataCache   = sportDataCache;
            _sportEventCache  = sportEventCache;
            _eventStatusCache = eventStatusCache;
            _matchStatusCache = matchStatusCache;
            _profileCache     = profileCache;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CacheMessageProcessor"/> class
        /// </summary>
        /// <param name="mapperFactory">A <see cref="ISingleTypeMapperFactory{removeSportEventStatus, SportEventStatusDTO}"/> used to created <see cref="ISingleTypeMapper{SportEventStatusDTO}"/> instances</param>
        /// <param name="sportEventCache">A <see cref="ISportEventCache"/> used to handle <see cref="fixture_change"/></param>
        /// <param name="cacheManager">A <see cref="ICacheManager"/> used to interact among caches</param>
        /// <param name="feedMessageHandler">A <see cref="IFeedMessageHandler"/> for handling special cases</param>
        /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> used to save eventId from BetPal to ignore timeline SES</param>
        public CacheMessageProcessor(ISingleTypeMapperFactory <sportEventStatus, SportEventStatusDTO> mapperFactory,
                                     ISportEventCache sportEventCache,
                                     ICacheManager cacheManager,
                                     IFeedMessageHandler feedMessageHandler,
                                     ISportEventStatusCache sportEventStatusCache)
        {
            Guard.Argument(mapperFactory, nameof(mapperFactory)).NotNull();
            Guard.Argument(sportEventCache, nameof(sportEventCache)).NotNull();
            Guard.Argument(cacheManager, nameof(cacheManager)).NotNull();
            Guard.Argument(feedMessageHandler, nameof(feedMessageHandler)).NotNull();
            Guard.Argument(sportEventStatusCache, nameof(sportEventStatusCache)).NotNull();

            ProcessorId = "CMP" + Guid.NewGuid().ToString().Substring(0, 4);

            _mapperFactory         = mapperFactory;
            _sportEventCache       = (SportEventCache)sportEventCache;
            _cacheManager          = cacheManager;
            _feedMessageHandler    = feedMessageHandler;
            _sportEventStatusCache = sportEventStatusCache;
        }
Example #16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Competition"/> class
        /// </summary>
        /// <param name="executionLog">A <see cref="ILog"/> instance used for execution logging</param>
        /// <param name="id">A <see cref="URN"/> uniquely identifying the sport event associated with the current instance</param>
        /// <param name="sportId">A <see cref="URN"/> uniquely identifying the sport associated with the current instance</param>
        /// <param name="sportEntityFactory">An instance of a <see cref="ISportEntityFactory"/> used to create <see cref="ISportEvent"/> instances</param>
        /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> instance containing cache data information about the progress of a sport event associated with the current instance</param>
        /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance containing <see cref="CompetitionCI"/></param>
        /// <param name="cultures">A <see cref="IEnumerable{CultureInfo}"/> specifying languages the current instance supports</param>
        /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying how the initialized instance will handle potential exceptions</param>
        /// <param name="matchStatusesCache">A <see cref="ILocalizedNamedValueCache"/> cache for fetching match statuses</param>
        internal Competition(ILog executionLog,
                             URN id,
                             URN sportId,
                             ISportEntityFactory sportEntityFactory,
                             ISportEventStatusCache sportEventStatusCache,
                             ISportEventCache sportEventCache,
                             IEnumerable <CultureInfo> cultures,
                             ExceptionHandlingStrategy exceptionStrategy,
                             ILocalizedNamedValueCache matchStatusesCache)
            : base(id, sportId, executionLog, sportEventCache, cultures, exceptionStrategy)
        {
            Contract.Requires(id != null);
            Contract.Requires(sportEntityFactory != null);
            Contract.Requires(sportEventStatusCache != null);
            Contract.Requires(matchStatusesCache != null);

            _sportEntityFactory   = sportEntityFactory;
            SportEventStatusCache = sportEventStatusCache;
            _matchStatusesCache   = matchStatusesCache;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Competition"/> class
        /// </summary>
        /// <param name="executionLog">A <see cref="ILogger"/> instance used for execution logging</param>
        /// <param name="id">A <see cref="URN"/> uniquely identifying the sport event associated with the current instance</param>
        /// <param name="sportId">A <see cref="URN"/> uniquely identifying the sport associated with the current instance</param>
        /// <param name="sportEntityFactory">An instance of a <see cref="ISportEntityFactory"/> used to create <see cref="ISportEvent"/> instances</param>
        /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> instance containing cache data information about the progress of a sport event associated with the current instance</param>
        /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance containing <see cref="CompetitionCI"/></param>
        /// <param name="cultures">A <see cref="IEnumerable{CultureInfo}"/> specifying languages the current instance supports</param>
        /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying how the initialized instance will handle potential exceptions</param>
        /// <param name="matchStatusesCache">A <see cref="ILocalizedNamedValueCache"/> cache for fetching match statuses</param>
        internal Competition(ILogger executionLog,
                             URN id,
                             URN sportId,
                             ISportEntityFactory sportEntityFactory,
                             ISportEventStatusCache sportEventStatusCache,
                             ISportEventCache sportEventCache,
                             IEnumerable <CultureInfo> cultures,
                             ExceptionHandlingStrategy exceptionStrategy,
                             ILocalizedNamedValueCache matchStatusesCache)
            : base(id, sportId, executionLog, sportEventCache, cultures, exceptionStrategy)
        {
            Guard.Argument(id, nameof(id)).NotNull();
            Guard.Argument(sportEntityFactory, nameof(sportEntityFactory)).NotNull();
            Guard.Argument(sportEventStatusCache, nameof(sportEventStatusCache)).NotNull();
            Guard.Argument(matchStatusesCache, nameof(matchStatusesCache)).NotNull();

            _sportEntityFactory   = sportEntityFactory;
            SportEventStatusCache = sportEventStatusCache;
            _matchStatusesCache   = matchStatusesCache;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SportEntityFactory"/> class
        /// </summary>
        /// <param name="sportDataCache">A <see cref="ISportDataCache"/> instance used to retrieve sport related info</param>
        /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance used to retrieve sport events</param>
        /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve statuses of sport events</param>
        /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param>
        /// <param name="profileCache">A <see cref="IProfileCache"/> used to retrieve player profiles</param>
        /// <param name="soccerSportUrns">A list of sport urns that have soccer matches</param>
        public SportEntityFactory(ISportDataCache sportDataCache,
                                  ISportEventCache sportEventCache,
                                  ISportEventStatusCache eventStatusCache,
                                  ILocalizedNamedValueCache matchStatusCache,
                                  IProfileCache profileCache,
                                  IReadOnlyCollection <URN> soccerSportUrns)
        {
            Guard.Argument(sportDataCache, nameof(sportDataCache)).NotNull();
            Guard.Argument(sportEventCache, nameof(sportEventCache)).NotNull();
            Guard.Argument(eventStatusCache, nameof(eventStatusCache)).NotNull();
            Guard.Argument(matchStatusCache, nameof(matchStatusCache)).NotNull();
            Guard.Argument(profileCache, nameof(profileCache)).NotNull();
            Guard.Argument(soccerSportUrns, nameof(soccerSportUrns)).NotNull();

            _sportDataCache   = sportDataCache;
            _sportEventCache  = sportEventCache;
            _eventStatusCache = eventStatusCache;
            _matchStatusCache = matchStatusCache;
            _profileCache     = profileCache;
            _soccerSportUrns  = soccerSportUrns;
        }