public LeagueAPIServiceTests(ILeagueApiConfiguration configuration) { configuration = configuration ?? new LeagueApiConfiguration(string.Empty, RegionEnum.Euw, true, new FakeHttpRequestService()); _leagueAPI = new LeagueApi(configuration); }
public LeagueAPIServiceTests(ILeagueApiConfiguration configuration) { configuration = configuration ?? new LeagueApiConfiguration(ApiKey, RegionEnum.Euw, true, HttpRequestService); _leagueAPI = new LeagueApi(configuration); }
public void SetUp() { leagueService = Substitute.For <ILeagueService>(); dbContext = DbContextUtility.CreateMockDb(); var logger = Substitute.For <ILogger <LeagueApi> >(); var configuration = Substitute.For <IConfiguration>(); testObj = new LeagueApi(logger, dbContext, leagueService, configuration); }
public async void SourceMappingTestAsync() { var fromSource1 = await _leagueAPI.Summoner.GetSummonerByNameAsync(SummonerName); var otherFromSource1 = await _leagueAPI.Summoner.GetSummonerByIdAsync(19231046); var source2 = new LeagueApi(string.Empty, RegionEnum.Na, true, new FakeHttpRequestService()); var fromSource2 = await source2.Summoner.GetSummonerByNameAsync(SummonerName); Assert.IsNotNull(fromSource1.ApiConfiguration); Assert.IsNotNull(otherFromSource1.ApiConfiguration); Assert.IsNotNull(fromSource2.ApiConfiguration); Assert.AreNotEqual(fromSource1.ApiConfiguration, fromSource2.ApiConfiguration); Assert.AreEqual(fromSource1.ApiConfiguration, otherFromSource1.ApiConfiguration); }