Skip to content

Commit

Permalink
Rename region enum names to start with uppercase letter (BenFradet#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Ouborny authored and BenFradet committed Apr 9, 2019
1 parent 93b3b93 commit edcccb6
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions RiotSharp.Test/CommonTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class CommonTestBase
public static string ApiKey = Configuration["ApiKey"];
public static string FaultyApiKey = "deadbeef-dead-beef-dead-beefdeadbeef";

public static Region Summoner1And2Region = (Region)Enum.Parse(typeof(Region), "na");
public static Region Summoner1And2Region = (Region)Enum.Parse(typeof(Region), "Na");

public static long InvalidSummonerId = -1;
public static string Summoner1Id = "fhOx2QJ2VKSaaD9nVJ4XJSzMBPW2es7FboigIwW5ss97coA";
Expand All @@ -29,7 +29,7 @@ public class CommonTestBase
public static string Summoner3Id = "I2QEPYTtazuZge0E31Ge7j8GiPFb2bva7LnJQK1-GJF6";
public static string Summoner3AccountId = "NRKCQCgDMkctfkkEcC-fEDNX3WwP4Ga8vQWqzdY3dcGL1Ho";
public static string Summoner3Name = "xsunx";
public static Region Summoner3Region = (Region)Enum.Parse(typeof(Region), "ru");
public static Region Summoner3Region = (Region)Enum.Parse(typeof(Region), "Ru");

/// <summary>
/// Ensures that test returns data (Shows test warnings for 404 status exceptions)
Expand Down
4 changes: 2 additions & 2 deletions RiotSharp.Test/EndpointTests/ThirdPartyEndpointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void GetThirdPartyCode_Test()
{
_requester.Setup(moq => moq.CreateGetRequestAsync(It.IsAny<string>(), It.IsAny<Region>(),
It.IsAny<List<string>>(), It.IsAny<bool>())).ReturnsAsync(response);
var code = _riotApi.ThirdParty.GetThirdPartyCodeBySummonerIdAsync(Region.na, "SummonerId").Result;
var code = _riotApi.ThirdParty.GetThirdPartyCodeBySummonerIdAsync(Region.Na, "SummonerId").Result;
Assert.AreEqual("someReponse", code);
}

Expand All @@ -41,7 +41,7 @@ public async Task GetThirdPartyCodeAsync_Test()
{
_requester.Setup(moq => moq.CreateGetRequestAsync(It.IsAny<string>(), It.IsAny<Region>(),
It.IsAny<List<string>>(), It.IsAny<bool>())).ReturnsAsync(response);
var code = await _riotApi.ThirdParty.GetThirdPartyCodeBySummonerIdAsync(Region.na, "SummonerId");
var code = await _riotApi.ThirdParty.GetThirdPartyCodeBySummonerIdAsync(Region.Na, "SummonerId");
Assert.AreEqual("someReponse", code);
}
}
Expand Down
4 changes: 2 additions & 2 deletions RiotSharp.Test/RiotApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void GetMatchAsync_Perks_Test()
{
EnsureCredibility(() =>
{
var match = Api.Match.GetMatchAsync(RiotSharp.Misc.Region.euw, RiotApiTestBase.PerksGameId).Result;
var match = Api.Match.GetMatchAsync(RiotSharp.Misc.Region.Euw, RiotApiTestBase.PerksGameId).Result;

Assert.AreEqual(RiotApiTestBase.PerksGameId, match.GameId);
Assert.IsNotNull(match.ParticipantIdentities);
Expand Down Expand Up @@ -311,7 +311,7 @@ public void GetCurrentGameAsync_Test()
{
EnsureCredibility(() =>
{
var currentGame = Api.Spectator.GetCurrentGameAsync(RiotSharp.Misc.Region.euw, "w1_k11kGq3N2zydfKN5xc7XcGwv-4jrnJJGsuQfHJmDFVFs").Result;
var currentGame = Api.Spectator.GetCurrentGameAsync(RiotSharp.Misc.Region.Euw, "w1_k11kGq3N2zydfKN5xc7XcGwv-4jrnJJGsuQfHJmDFVFs").Result;

Assert.IsNotNull(currentGame);
Assert.IsTrue(currentGame.GameId != 0);
Expand Down
2 changes: 1 addition & 1 deletion RiotSharp.Test/RiotApiTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal class RiotApiTestBase : CommonTestBase
"LL Stylish"
};

public static Region SummonersRegion = (Region) Enum.Parse(typeof(Region), "na");
public static Region SummonersRegion = (Region) Enum.Parse(typeof(Region), "Na");
public static string Queue = "RANKED_SOLO_5x5";

// Normal 5v5 Draft Pick games
Expand Down
2 changes: 1 addition & 1 deletion RiotSharp.Test/TournamentRiotApiTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TournamentRiotApiTestBase : CommonTestBase

protected static readonly TournamentRiotApi api = TournamentRiotApi.GetInstance(TournamentApiKey, useStub: true);

public static int ProviderId = api.CreateProviderAsync(Region.na, TournamentUrl).GetAwaiter().GetResult();
public static int ProviderId = api.CreateProviderAsync(Region.Na, TournamentUrl).GetAwaiter().GetResult();
public static int TournamentId = api.CreateTournamentAsync(ProviderId, TournamentName).GetAwaiter().GetResult();
public static string TournamentCode = api.CreateTournamentCodesAsync(TournamentId, 1, 5, tournamentSpectatorType, tournamentPickType, tournamentMapType).GetAwaiter().GetResult().First();
}
Expand Down
24 changes: 12 additions & 12 deletions RiotSharp/Http/RequesterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,29 +124,29 @@ private string GetPlatform(Region region)
{
switch (region)
{
case Region.br:
case Region.Br:
return "br1";
case Region.eune:
case Region.Eune:
return "eun1";
case Region.euw:
case Region.Euw:
return "euw1";
case Region.jp:
case Region.Jp:
return "jp1";
case Region.kr:
case Region.Kr:
return "kr";
case Region.lan:
case Region.Lan:
return "la1";
case Region.las:
case Region.Las:
return "la2";
case Region.na:
case Region.Na:
return "na1";
case Region.oce:
case Region.Oce:
return "oc1";
case Region.tr:
case Region.Tr:
return "tr1";
case Region.ru:
case Region.Ru:
return "ru";
case Region.global:
case Region.Global:
return "global";
case Region.Americas:
return "americas";
Expand Down
24 changes: 12 additions & 12 deletions RiotSharp/Misc/Converters/PlatformConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,31 @@ public static Region ConvertToRegion(this Platform platform)
switch (platform)
{
case Platform.NA1:
return Region.na;
return Region.Na;
case Platform.BR1:
return Region.br;
return Region.Br;
case Platform.LA1:
return Region.lan;
return Region.Lan;
case Platform.LA2:
return Region.las;
return Region.Las;
case Platform.OC1:
return Region.oce;
return Region.Oce;
case Platform.EUN1:
return Region.eune;
return Region.Eune;
case Platform.TR1:
return Region.tr;
return Region.Tr;
case Platform.RU:
return Region.ru;
return Region.Ru;
case Platform.EUW1:
return Region.euw;
return Region.Euw;
case Platform.KR:
return Region.kr;
return Region.Kr;
case Platform.JP1:
return Region.jp;
return Region.Jp;
case Platform.NoPlatform:
return Region.NoRegion;
default:
return Region.na;
return Region.Na;
}
}
}
Expand Down
22 changes: 11 additions & 11 deletions RiotSharp/Misc/Converters/RegionConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,36 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
{
case "BR":
case "br":
return Region.br;
return Region.Br;
case "EUNE":
case "eune":
return Region.eune;
return Region.Eune;
case "EUW":
case "euw":
return Region.euw;
return Region.Euw;
case "KR":
return Region.kr;
return Region.Kr;
case "LAN":
case "lan":
return Region.lan;
return Region.Lan;
case "LAS":
case "las":
return Region.las;
return Region.Las;
case "NA":
case "na":
return Region.na;
return Region.Na;
case "OCE":
case "oce":
return Region.oce;
return Region.Oce;
case "RU":
case "ru":
return Region.ru;
return Region.Ru;
case "TR":
case "tr":
return Region.tr;
return Region.Tr;
case "JP":
case "jp":
return Region.jp;
return Region.Jp;
default:
return null;
}
Expand Down
24 changes: 12 additions & 12 deletions RiotSharp/Misc/Region.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,62 @@ public enum Region
/// <summary>
/// Brasil.
/// </summary>
br,
Br,

/// <summary>
/// North-eastern europe.
/// </summary>
eune,
Eune,

/// <summary>
/// Western europe.
/// </summary>
euw,
Euw,

/// <summary>
/// North america.
/// </summary>
na,
Na,

/// <summary>
/// South korea.
/// </summary>
kr,
Kr,

/// <summary>
/// Latin America North.
/// </summary>
lan,
Lan,

/// <summary>
/// Latin America South.
/// </summary>
las,
Las,

/// <summary>
/// Oceania.
/// </summary>
oce,
Oce,

/// <summary>
/// Russia.
/// </summary>
ru,
Ru,

/// <summary>
/// Turkey.
/// </summary>
tr,
Tr,

/// <summary>
/// Japan.
/// </summary>
jp,
Jp,

/// <summary>
/// Global.
/// </summary>
global,
Global,

/// <summary>
/// Regional proxy for services only deployed in North America. For example the tournament and tournament stub services.
Expand Down

0 comments on commit edcccb6

Please sign in to comment.