Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions src/World.Net.UnitTests/Countries/GeorgiaTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
namespace World.Net.UnitTests.Countries;

public sealed class GeorgiaTest : AssertCountryTestBase
{
private const string GEORGIA_COUNTRY_NAME = "Georgia";
private const string GEORGIA_NATIVE_NAME = "საქართველო";
private const string GEORGIA_CAPITAL = "Tbilisi";
private const string GEORGIA_OFFICIAL_NAME = "Georgia";
private const string GEORGIA_ISO2_CODE = "GE";
private const string GEORGIA_ISO3_CODE = "GEO";
private const int GEORGIA_NUMERIC_CODE = 268;
private readonly string[] GEORGIA_CALLING_CODE = ["+995"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Georgia;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
// Autonomous Republics
new("Abkhazia", "GE-AB", "Autonomous Republic"),
new("Adjara", "GE-AJ", "Autonomous Republic"),

// Regions
new("Guria", "GE-GU", "Region"),
new("Imereti", "GE-IM", "Region"),
new("Kakheti", "GE-KA", "Region"),
new("Kvemo Kartli", "GE-KK", "Region"),
new("Mtskheta-Mtianeti", "GE-MM", "Region"),
new("Racha-Lechkhumi and Kvemo Svaneti", "GE-RL", "Region"),
new("Samegrelo-Zemo Svaneti", "GE-SZ", "Region"),
new("Samtskhe-Javakheti", "GE-SJ", "Region"),
new("Shida Kartli", "GE-SK", "Region"),

// Capital city
new("Tbilisi", "GE-TB", "City")
];

[Fact]
public void GetCountry_ReturnsCorrectInformation_ForGeorgia()
{
// Arrange
// Act
var country = CountryProvider.GetCountry(EXPECTEDID);

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
GEORGIA_COUNTRY_NAME,
GEORGIA_OFFICIAL_NAME,
GEORGIA_NATIVE_NAME,
GEORGIA_CAPITAL,
GEORGIA_NUMERIC_CODE,
GEORGIA_ISO2_CODE,
GEORGIA_ISO3_CODE,
GEORGIA_CALLING_CODE,
EXPECTED_STATES
);
}
}

53 changes: 53 additions & 0 deletions src/World.Net/Countries/Georgia.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
namespace World.Net.Countries;

internal sealed class Georgia : ICountry
{
//<inheritdoc/>
public CountryIdentifier Id => CountryIdentifier.Georgia;

//<inheritdoc/>
public string Name { get; } = "Georgia";

//<inheritdoc/>
public string OfficialName { get; } = "Georgia";

//<inheritdoc/>
public string NativeName => "საქართველო";

//<inheritdoc/>
public string Capital { get; } = "Tbilisi";

//<inheritdoc/>
public int NumericCode { get; } = 268;

//<inheritdoc/>
public string ISO2Code { get; } = "GE";

//<inheritdoc/>
public string ISO3Code { get; } = "GEO";

//<inheritdoc/>
public string[] CallingCode { get; } = ["+995"];

//<inheritdoc/>
public IEnumerable<State> States =>
[
// Autonomous Republics
new("Abkhazia", "GE-AB", "Autonomous Republic"),
new("Adjara", "GE-AJ", "Autonomous Republic"),

// Regions
new("Guria", "GE-GU", "Region"),
new("Imereti", "GE-IM", "Region"),
new("Kakheti", "GE-KA", "Region"),
new("Kvemo Kartli", "GE-KK", "Region"),
new("Mtskheta-Mtianeti", "GE-MM", "Region"),
new("Racha-Lechkhumi and Kvemo Svaneti", "GE-RL", "Region"),
new("Samegrelo-Zemo Svaneti", "GE-SZ", "Region"),
new("Samtskhe-Javakheti", "GE-SJ", "Region"),
new("Shida Kartli", "GE-SK", "Region"),

// Capital city
new("Tbilisi", "GE-TB", "City")
];
}
1 change: 1 addition & 0 deletions src/World.Net/Helpers/CountryInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static Dictionary<CountryIdentifier, ICountry> Initialize()
{ CountryIdentifier.FrenchGuiana, new FrenchGuiana() },
{ CountryIdentifier.FrenchPolynesia, new FrenchPolynesia() },
{ CountryIdentifier.Gabon, new Gabon() },
{ CountryIdentifier.Georgia, new Georgia() },
{ CountryIdentifier.Iraq, new Iraq() },
{ CountryIdentifier.Ireland, new Ireland() },
{ CountryIdentifier.Israel, new Israel() },
Expand Down