2023-01-22 04:02:33 +00:00
|
|
|
using FluentAssertions;
|
2018-11-06 23:25:35 +00:00
|
|
|
using Xunit;
|
|
|
|
|
2023-01-22 04:02:33 +00:00
|
|
|
namespace PKHeX.Core.Tests.Util;
|
2022-06-18 18:04:24 +00:00
|
|
|
|
|
|
|
public class GeoLocationTests
|
2018-11-06 23:25:35 +00:00
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
[Theory]
|
|
|
|
[InlineData("en", 1, "Japan")]
|
2023-01-22 04:02:33 +00:00
|
|
|
public void ReturnsCorrectCountryNameByString(string language, byte 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")]
|
2023-01-22 04:02:33 +00:00
|
|
|
public void ReturnsCorrectCountryNameByLanguageId(LanguageID languageId, byte country, string expectedName)
|
2022-06-18 18:04:24 +00:00
|
|
|
{
|
|
|
|
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")]
|
2023-01-22 04:02:33 +00:00
|
|
|
public void ReturnsCorrectRegionNameByString(string language, byte country, byte region, string expectedName)
|
2022-06-18 18:04:24 +00:00
|
|
|
{
|
|
|
|
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, "버뮤다")]
|
2023-01-22 04:02:33 +00:00
|
|
|
public void ReturnsCorrectRegionNameByLanguageId(LanguageID languageId, byte country, byte region, string expectedName)
|
2022-06-18 18:04:24 +00:00
|
|
|
{
|
|
|
|
GeoLocation.GetRegionName(languageId, country, region).Should().Be(expectedName);
|
2018-11-06 23:25:35 +00:00
|
|
|
}
|
|
|
|
}
|