2018-11-06 23:25:35 +00:00
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using PKHeX.Core;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
namespace PKHeX.Tests.Util;
|
|
|
|
|
|
|
|
|
|
public class GeoLocationTests
|
2018-11-06 23:25:35 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData("en", 1, "Japan")]
|
|
|
|
|
public void ReturnsCorrectCountryNameByString(string language, int country, string expectedName)
|
2018-11-06 23:25:35 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
GeoLocation.GetCountryName(language, country).Should().Be(expectedName);
|
|
|
|
|
}
|
2018-11-06 23:25:35 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData(LanguageID.English, 10, "Argentina")]
|
|
|
|
|
public void ReturnsCorrectCountryNameByLanguageId(LanguageID languageId, int country, string expectedName)
|
|
|
|
|
{
|
|
|
|
|
GeoLocation.GetCountryName(languageId, country).Should().Be(expectedName);
|
|
|
|
|
}
|
2018-11-06 23:25:35 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData("en", 1, 2, "Tokyo")]
|
|
|
|
|
public void ReturnsCorrectRegionNameByString(string language, int country, int region, string expectedName)
|
|
|
|
|
{
|
|
|
|
|
GeoLocation.GetRegionName(language, country, region).Should().Be(expectedName);
|
|
|
|
|
}
|
2018-11-06 23:25:35 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData(LanguageID.Korean, 186, 1, "버뮤다")]
|
|
|
|
|
public void ReturnsCorrectRegionNameByLanguageId(LanguageID languageId, int country, int region, string expectedName)
|
|
|
|
|
{
|
|
|
|
|
GeoLocation.GetRegionName(languageId, country, region).Should().Be(expectedName);
|
2018-11-06 23:25:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|