public async void ProvideValidGamertagList_ReturnsAll3ResultsWithSuccess(string gamertag1, string gamertag2, string gamertag3) { var result = await HaloApiService.GetArenaServiceRecords(new[] { gamertag1, gamertag2, gamertag3 }); Assert.IsTrue(result.Results.ElementAt(0).ResultCode == ResultCode.Success); Assert.IsTrue(result.Results.ElementAt(1).ResultCode == ResultCode.Success); Assert.IsTrue(result.Results.ElementAt(2).ResultCode == ResultCode.Success); }
public async void ProvideValidSeasonId_ReturnsKnownGame(string gamertag1) { string seasonId = "54c9ee4f-d041-44ef-bd10-2c2f71edb5a4"; var result = await HaloApiService.GetArenaServiceRecords(new[] { gamertag1 }, seasonId); Assert.IsTrue(result.Results.Count() == 1); Assert.AreEqual(result.Results.First().Result.ArenaStats.MedalAwards.Count(), 105); }
public void ChangeTokenToInvalid_ThrowAccessDenied(string token) { RequestRateHttpClient.SetAPIToken(token); Assert.Throws <HaloAPIException>(async() => await HaloApiService.GetArenaServiceRecords(new[] { "Glitch100" }), CommonErrorMessages.AccessDenied); }
public void Default_DoesNotThrowException() { Assert.DoesNotThrow(async() => await HaloApiService.GetArenaServiceRecords(new [] { "Glitch100" })); }
public async void ProvideValidGamertagList_ReturnsAll3Result(string gamertag1, string gamertag2, string gamertag3) { var result = await HaloApiService.GetArenaServiceRecords(new[] { gamertag1, gamertag2, gamertag3 }); Assert.IsTrue(result.Results.Count() == 3); }
public async void ProvideValidGamertag_ReturnsSingleResult(string gamertag) { var result = await HaloApiService.GetArenaServiceRecords(new[] { "Glitch100" }); Assert.IsTrue(result.Results.Count() == 1); }
public async void ProvideInvalidGamertag_ReturnsNotFoundResult() { var result = await HaloApiService.GetArenaServiceRecords(new[] { "ASFASFEAFEA" }); Assert.IsTrue(result.Results.FirstOrDefault().ResultCode == ResultCode.NotFound); }
public async void Default_DoesNotReturnNull() { var result = await HaloApiService.GetArenaServiceRecords(new[] { "Glitch100" }); Assert.IsNotNull(result); }