forked from selfmadecode/world.net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimorLesteTest.cs
More file actions
40 lines (36 loc) · 1.87 KB
/
TimorLesteTest.cs
File metadata and controls
40 lines (36 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
namespace World.Net.UnitTests.Countries;
public sealed class TimorLesteTest
{
private const string TIMORLESTE_COUNTRY_NAME = "Timor-Leste";
private const string TIMORLESTE_NATIVE_NAME = "Repúblika Demokrátika Timór-Leste";
private const string TIMORLESTE_CAPITAL = "Dili";
private const string TIMORLESTE_OFFICIAL_NAME = "Democratic Republic of Timor-Leste";
private const string TIMORLESTE_ISO2_CODE = "TL";
private const string TIMORLESTE_ISO3_CODE = "TLS";
private const int TIMORLESTE_NUMERIC_CODE = 626;
private const string TIMORLESTE_CALLING_CODE = "+670";
private const int TIMORLESTE_STATE_COUNT = 13; // 12 municipalities + 1 special administrative region
private static readonly string[] VALID_STATE_TYPES = { "Municipality", "Special Administrative Region" };
[Fact]
public void GetCountry_ReturnsCorrectInformation_ForTimorLeste()
{
// Arrange
CountryIdentifier existingCountryId = CountryIdentifier.TimorLeste;
// Act
var country = CountryProvider.GetCountry(existingCountryId);
// Assert
Assert.NotNull(country);
Assert.Equal(existingCountryId, country.Id);
Assert.Equal(TIMORLESTE_COUNTRY_NAME, country.Name);
Assert.Equal(TIMORLESTE_OFFICIAL_NAME, country.OfficialName);
Assert.Equal(TIMORLESTE_NATIVE_NAME, country.NativeName);
Assert.Equal(TIMORLESTE_CAPITAL, country.Capital);
Assert.Equal(TIMORLESTE_NUMERIC_CODE, country.NumericCode);
Assert.Equal(TIMORLESTE_ISO2_CODE, country.ISO2Code);
Assert.Equal(TIMORLESTE_ISO3_CODE, country.ISO3Code);
Assert.Equal(TIMORLESTE_CALLING_CODE, country.CallingCode);
Assert.NotNull(country.States);
Assert.Equal(TIMORLESTE_STATE_COUNT, country.States.Count());
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
}
}