Skip to content

Commit

Permalink
Update tests for removal of ChampionMasterV4 summoner ID endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
MingweiSamuel committed Jan 4, 2024
1 parent 6dcc80a commit 95741ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
38 changes: 13 additions & 25 deletions tests/Camille.RiotGames.Test/ApiChampionMasteryV4Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ namespace Camille.RiotGames.Test
[TestClass]
public class ApiChampionMasteryV4Test : ApiTest
{

[TestMethod]
public async Task GetChampionAsync()
public void GetChampion()
{
CheckGetChampion(await Api.ChampionMasteryV4().GetChampionMasteryAsync(PlatformRoute.NA1, encryptedSummonerId: SummonerIdLugnutsK, championId: Champion.ZYRA));
var summoner = Api.SummonerV4().GetBySummonerName(PlatformRoute.NA1, "LugnutsK");
CheckGetChampion(Api.ChampionMasteryV4().GetChampionMasteryByPUUID(PlatformRoute.NA1, encryptedPUUID: summoner.Puuid, championId: Champion.ZYRA));
}

[TestMethod]
public void GetChampion()
public async Task GetChampionAsync()
{
CheckGetChampion(Api.ChampionMasteryV4().GetChampionMastery(PlatformRoute.NA1, encryptedSummonerId: SummonerIdLugnutsK, championId: Champion.ZYRA));
var summoner = await Api.SummonerV4().GetBySummonerNameAsync(PlatformRoute.NA1, "LugnutsK");
CheckGetChampion(await Api.ChampionMasteryV4().GetChampionMasteryByPUUIDAsync(PlatformRoute.NA1, encryptedPUUID: summoner.Puuid, championId: Champion.ZYRA));
}

public static void CheckGetChampion(ChampionMastery result)
Expand All @@ -31,13 +34,15 @@ public static void CheckGetChampion(ChampionMastery result)
[TestMethod]
public void GetChampions()
{
CheckGetChampions(Api.ChampionMasteryV4().GetAllChampionMasteries(PlatformRoute.NA1, SummonerIdLugnutsK));
var summoner = Api.SummonerV4().GetBySummonerName(PlatformRoute.NA1, "LugnutsK");
CheckGetChampions(Api.ChampionMasteryV4().GetAllChampionMasteriesByPUUID(PlatformRoute.NA1, summoner.Puuid));
}

[TestMethod]
public async Task GetChampionsAsync()
{
CheckGetChampions(await Api.ChampionMasteryV4().GetAllChampionMasteriesAsync(PlatformRoute.NA1, SummonerIdLugnutsK));
var summoner = await Api.SummonerV4().GetBySummonerNameAsync(PlatformRoute.NA1, "LugnutsK");
CheckGetChampions(await Api.ChampionMasteryV4().GetAllChampionMasteriesByPUUIDAsync(PlatformRoute.NA1, summoner.Puuid));
}

public static void CheckGetChampions(ChampionMastery[] champData)
Expand All @@ -54,34 +59,17 @@ public static void CheckGetChampions(ChampionMastery[] champData)
}

[TestMethod]
[Ignore]
public void GetScore()
{
// http://www.lolking.net/summoner/euw/20401158/0#champ-mastery
CheckGetScore(Api.ChampionMasteryV4().GetChampionMasteryScore(PlatformRoute.EUW1, SummonerIdMa5tery));
}

[TestMethod]
[Ignore]
public async Task GetScoreAsync()
{
var summoner = await Api.SummonerV4().GetBySummonerNameAsync(PlatformRoute.EUW1, "Ma5tery");
CheckGetScore(await Api.ChampionMasteryV4().GetChampionMasteryScoreAsync(PlatformRoute.EUW1, summoner.Puuid));
}

[TestMethod]
[Ignore]
public void GetScoreByPUUID()
{
var summoner = Api.SummonerV4().GetBySummonerName(PlatformRoute.EUW1, "Ma5tery");
CheckGetScore(Api.ChampionMasteryV4().GetChampionMasteryScoreByPUUID(PlatformRoute.EUW1, summoner.Puuid));
}

[TestMethod]
[Ignore]
public async Task GetScoreByPUUIDAsync()
{
CheckGetScore(await Api.ChampionMasteryV4().GetChampionMasteryScoreByPUUIDAsync(PlatformRoute.EUW1, SummonerIdMa5tery));
var summoner = await Api.SummonerV4().GetBySummonerNameAsync(PlatformRoute.EUW1, "Ma5tery");
CheckGetScore(await Api.ChampionMasteryV4().GetChampionMasteryScoreByPUUIDAsync(PlatformRoute.EUW1, summoner.Puuid));
}

public static void CheckGetScore(int score)
Expand Down
2 changes: 1 addition & 1 deletion tests/Camille.RiotGames.Test/ReadmeExampleV4Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void SummonerChampionMastery()
Console.WriteLine($"{summoner.Name}'s Top 10 Champs:");

var masteries =
riotApi.ChampionMasteryV4().GetAllChampionMasteries(PlatformRoute.NA1, summoner.Id);
riotApi.ChampionMasteryV4().GetAllChampionMasteriesByPUUID(PlatformRoute.NA1, summoner.Puuid);

for (var i = 0; i < 10; i++)
{
Expand Down

0 comments on commit 95741ea

Please sign in to comment.