public async void ProvideStartAndCount_GetValidReponse(string gamerTag, int start, int count) { var result = await HaloApiService.GetMatchesForPlayer(gamerTag, GameMode.All, start, count); Assert.AreEqual(result.Count, count); Assert.AreEqual(result.Start, start); }
public async void Success_ReturnsKnownImage() { var result = await HaloApiService.GetMapVariant(_validId); Assert.AreEqual(result.MapImageUrl, "https://content.halocdn.com/media/Default/games/halo-5-guardians/map-images/arena/empire-34bb3fecab0e4962844d1fdd436d0bcf.jpg"); }
public async void ProvideValidMatchId_ValidData() { var result = await HaloApiService.GetArenaPostGameCarnageReport(new Guid("3f35f75c-aee4-437a-9b49-535ba2e5f186")); Assert.IsTrue(result.PlayerStats.Any(ps => ps.Player.Gamertag == "Glitch100")); }
public async void ProvideValidGamertagList_ReturnsAll3Result(string gamertag1, string gamertag2, string gamertag3) { var result = await HaloApiService.GetWarzoneServiceRecords(new[] { gamertag1, gamertag2, gamertag3 }); Assert.IsTrue(result.Results.Count() == 3); }
public async void ProvideValidMatchId_ReturnsKnownPlayer(string gamerTag) { var result = await HaloApiService.GetWarzonePostGameCarnageReport(_validGuid); Assert.IsTrue( result.PlayerStats.Any( ps => ps.Player.Gamertag.Equals(gamerTag, StringComparison.InvariantCultureIgnoreCase))); }
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 ReturnedObject_ContainsCorrectXp() { var result = await HaloApiService.GetSpartanRanks(); var known = result.First(r => r.ContentId == new Guid("5f6e9682-b192-4aa5-9516-883d23e31aec")); Assert.AreEqual(known.StartXP, 10700); }
public async void ProvideValidDetails_ReturnsKnownProperties() { const string gamerTag = "ARC GuiltySpark"; var result = await HaloApiService.GetUGCGameVariant(gamerTag, "dfb9efd0-53a9-4889-9c63-01f666e8af98"); Assert.AreEqual(gamerTag, result.Identity.Owner); Assert.IsNotNull(result); }
public async void ProvideValidDetails_ReturnsKnownProperties() { const string gamerTag = "ARC GuiltySpark"; var result = await HaloApiService.GetUGCGameVariant(gamerTag, "17ce1aba-376b-470c-bce3-f90bfbac41f9"); Assert.AreEqual(gamerTag, result.Identity.Owner); Assert.IsNotNull(result); }
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 async void ProvideValidMatchId_MetaCommendationDeltasAreSet(string matchId) { var result = await HaloApiService.GetArenaPostGameCarnageReport(new Guid(matchId)); // The player earned the final level of the "Storm the Walls" Meta commendation var player = result.PlayerStats.FirstOrDefault(ps => ps.Player.Gamertag == "N 2the eighbor"); Assert.IsNotNull(player, "Player should exist in results"); var guid = player.MetaCommendationDeltas.First().PreviousMetRequirements.First().Guid; Assert.AreEqual(new Guid("af14745e-776d-4307-8e1d-3c0fa0520464"), guid, "Requirement guid should be correct"); }
public async void ProvideValidMatchId_MetaCommendationDeltasAreSet(string matchId) { var result = await HaloApiService.GetWarzonePostGameCarnageReport(new Guid(matchId)); // The player earned the final level of the "Assistant" Meta commendation var player = result.PlayerStats.FirstOrDefault(ps => ps.Player.Gamertag == "larry chimp man"); Assert.IsNotNull(player, "Player should exist in results"); var guid = player.MetaCommendationDeltas.First().PreviousMetRequirements.First().Guid; Assert.AreEqual(new Guid("7077a782-ccba-4b0b-b2fd-5023a61fbb4c"), guid, "Requirement guid should be correct"); }
public void Default_DoesNotThrowException() { Assert.DoesNotThrow(async() => await HaloApiService.GetSpartanImage("Test")); }
public async void Default_DoesNotReturnNull() { var result = await HaloApiService.GetSpartanImage("Glitch100"); Assert.IsNotNull(result); }
public async void Success_ReturnsDefaultWidth() { var result = await HaloApiService.GetSpartanImage("Glitch100"); Assert.AreEqual(256, result.Width); }
public void KnownInvalid_ThrowException() { Assert.Throws <HaloAPIException>(async() => await HaloApiService.GetRequisitionPack(Guid.Empty), CommonErrorMessages.BadRequest); }
public async void Default_DoesNotReturnNull(string id) { var result = await HaloApiService.GetRequisitionPack(new Guid(id)); Assert.IsNotNull(result); }
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.GetRequisitionPack(validId), CommonErrorMessages.BadRequest); }
public async void Default_ReturnsKnownMission() { var result = await HaloApiService.GetCommendations(); Assert.IsTrue(result.Any(r => r.Id == new Guid("20dc7d74-be8f-4a60-ae4f-15230855cced"))); }
public void Default_DoesNotThrowException() { Assert.DoesNotThrow(async() => await HaloApiService.GetFlexibleStats()); }
public async void Default_DoesNotReturnNull(string id) { var result = await HaloApiService.GetGameVariant(id); Assert.IsNotNull(result); }
public async void ProvideValidMatchId_ReturnsKnownMapId() { var result = await HaloApiService.GetWarzonePostGameCarnageReport(_validGuid); Assert.AreEqual(result.MapId, new Guid("cb251c51-f206-11e4-8541-24be05e24f7e")); }
public async void Default_PlaylistsNotEmpty() { var result = await HaloApiService.GetSeasons(); Assert.True(result.All(r => r.Playlists.Any())); }
public async void Default_DoesNotReturnNull() { var result = await HaloApiService.GetSeasons(); Assert.IsNotNull(result); }
public async void ProvideValidMatchId_ReturnsKnownDuration() { var result = await HaloApiService.GetWarzonePostGameCarnageReport(_validGuid); Assert.AreEqual(result.TotalDuration.ToString(), "00:17:16.8890008"); }
public async void Default_ReturnsValidCollection() { var result = await HaloApiService.GetSeasons(); CollectionAssert.AllItemsAreNotNull(result); }
public async void Default_ReturnsKnownMission() { var result = await HaloApiService.GetCampaignMissions(); Assert.IsTrue(result.Any(r => r.Id == new Guid("73ed1fd0-45e5-4bb9-ab6a-d2852c04ea7d"))); }
public void Default_DoesNotThrowException() { Assert.DoesNotThrow(async() => await HaloApiService.GetSeasons()); }
public void KnownInvalid_ThrowException() { Assert.Throws <HaloAPIException>(async() => await HaloApiService.GetGameVariant("afaf"), CommonErrorMessages.BadRequest); }