Exemplo n.º 1
0
        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);
        }
Exemplo n.º 3
0
 public void ChangeTokenToInvalid_ThrowAccessDenied(string token)
 {
     RequestRateHttpClient.SetAPIToken(token);
     Assert.Throws <HaloAPIException>(async() => await HaloApiService.GetArenaServiceRecords(new[] { "Glitch100" }), CommonErrorMessages.AccessDenied);
 }
Exemplo n.º 4
0
 public void Default_DoesNotThrowException()
 {
     Assert.DoesNotThrow(async() => await HaloApiService.GetArenaServiceRecords(new [] { "Glitch100" }));
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        public async void ProvideValidGamertag_ReturnsSingleResult(string gamertag)
        {
            var result = await HaloApiService.GetArenaServiceRecords(new[] { "Glitch100" });

            Assert.IsTrue(result.Results.Count() == 1);
        }
Exemplo n.º 7
0
        public async void ProvideInvalidGamertag_ReturnsNotFoundResult()
        {
            var result = await HaloApiService.GetArenaServiceRecords(new[] { "ASFASFEAFEA" });

            Assert.IsTrue(result.Results.FirstOrDefault().ResultCode == ResultCode.NotFound);
        }
Exemplo n.º 8
0
        public async void Default_DoesNotReturnNull()
        {
            var result = await HaloApiService.GetArenaServiceRecords(new[] { "Glitch100" });

            Assert.IsNotNull(result);
        }