コード例 #1
0
        public LeagueAPIServiceTests(ILeagueApiConfiguration configuration)
        {
            configuration = configuration ??
                            new LeagueApiConfiguration(string.Empty, RegionEnum.Euw, true, new FakeHttpRequestService());

            _leagueAPI = new LeagueApi(configuration);
        }
コード例 #2
0
        public LeagueAPIServiceTests(ILeagueApiConfiguration configuration)
        {
            configuration = configuration ??
                            new LeagueApiConfiguration(ApiKey, RegionEnum.Euw, true, HttpRequestService);

            _leagueAPI = new LeagueApi(configuration);
        }
コード例 #3
0
        public LeagueAPIServiceTests(ILeagueApiConfiguration configuration)
        {
            configuration = configuration ??
                            new LeagueApiConfiguration(ApiKey, RegionEnum.Euw, true, HttpRequestService);

            _leagueAPI = new LeagueApi(configuration);
        }
コード例 #4
0
        protected BaseService(
            ILeagueApiConfiguration apiConfiguration,
            VersionEnum version,
            string prefix,
            bool isLimitedByRateLimit = true)
        {
            if (apiConfiguration == null)
            {
                throw new ArgumentNullException("apiConfiguration");
            }
            if (prefix == null)
            {
                throw new ArgumentNullException("prefix");
            }

            _apiConfiguration = apiConfiguration;

            _version = version;
            Prefix   = prefix;
            _isLimitedByRateLimit = isLimitedByRateLimit;

            if (!LastRequests.ContainsKey(_apiConfiguration.Key))
            {
                LastRequests[_apiConfiguration.Key] = new List <DateTime>();
            }

            AutoMapperService = new AutoMapperService(apiConfiguration);

            AutoMapperService.CreateMap <long, DateTime>()
            .ConvertUsing(x => new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(x));
        }
コード例 #5
0
        public LeagueService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V2Rev4, "league")
        {
            Models.League.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #6
0
        public GameService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V1Rev3, "game")
        {
            Models.Game.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #7
0
        public GameService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V1Rev3, "game")
        {
            Models.Game.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #8
0
        public ChampionService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V1Rev2, "champion")
        {
            Models.Champion.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #9
0
        public LeagueService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V2Rev5, "league")
        {
            Models.League.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #10
0
        public TeamService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V2Rev4, "team")
        {
            Models.Team.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #11
0
        public ChampionService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V1Rev2, "champion")
        {
            Models.Champion.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #12
0
        public TeamService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V2Rev3, "team")
        {
            Models.Team.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #13
0
        public LeagueApi(ILeagueApiConfiguration leagueApiConfiguration)
        {
            if (leagueApiConfiguration == null)
            {
                throw new ArgumentNullException("leagueApiConfiguration");
            }

            LeagueApiConfiguration = leagueApiConfiguration;

            Init();
        }
コード例 #14
0
        public LeagueApi(ILeagueApiConfiguration leagueApiConfiguration)
        {
            if (leagueApiConfiguration == null)
            {
                throw new ArgumentNullException("leagueApiConfiguration");
            }

            LeagueApiConfiguration = leagueApiConfiguration;

            Init();
        }
コード例 #15
0
        public StatsService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V1Rev3, "stats")
        {
            RankedStats.CreateMap(AutoMapperService);
            PlayerStatsSummary.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #16
0
        public StatsService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V1Rev3, "stats")
        {
            RankedStats.CreateMap(AutoMapperService);
            PlayerStatsSummary.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #17
0
        public SummonerService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V1Rev4, "summoner")
        {
            MasteryPage.CreateMap(AutoMapperService);
            RunePage.CreateMap(AutoMapperService);
            Models.Summoner.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #18
0
        public SummonerService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V1Rev4, "summoner")
        {
            MasteryPage.CreateMap(AutoMapperService);
            RunePage.CreateMap(AutoMapperService);
            Models.Summoner.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #19
0
        public StaticService(
            ILeagueApiConfiguration config)
            : base(config, VersionEnum.V1Rev2, "static-data", false)
        {
            ChampionList.CreateMap(AutoMapperService);
            ItemList.CreateMap(AutoMapperService);
            MasteryList.CreateMap(AutoMapperService);
            Realm.CreateMap(AutoMapperService);
            RuneList.CreateMap(AutoMapperService);
            SummonerSpellList.CreateMap(AutoMapperService);

#if DEBUG
            AutoMapperService.AssertConfigurationIsValid();
#endif
        }
コード例 #20
0
        public LeagueApi(
            string apiKey,
            RegionEnum? region = null,
            bool waitToAvoidRateLimit = false,
            IHttpRequestService httpRequestService = null)
        {
            if (apiKey == null)
            {
                throw new ArgumentNullException("apiKey");
            }

            httpRequestService = httpRequestService ?? new HttpRequestService();

            LeagueApiConfiguration = new LeagueApiConfiguration(apiKey, region, waitToAvoidRateLimit, httpRequestService);

            Init();
        }
コード例 #21
0
        public LeagueApi(
            string apiKey,
            RegionEnum?region         = null,
            bool waitToAvoidRateLimit = false,
            IHttpRequestService httpRequestService = null)
        {
            if (apiKey == null)
            {
                throw new ArgumentNullException("apiKey");
            }

            httpRequestService = httpRequestService ?? new HttpRequestService();

            LeagueApiConfiguration = new LeagueApiConfiguration(apiKey, region, waitToAvoidRateLimit, httpRequestService);

            Init();
        }
コード例 #22
0
 internal AutoMapperService(ILeagueApiConfiguration apiConfiguration)
 {
     _configurationStore = new ConfigurationStore(new TypeMapFactory(), MapperRegistry.Mappers);
     _mappingEngine = new MappingEngine(_configurationStore);
     _apiConfiguration = apiConfiguration;
 }