-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEstoniaTest.cs
More file actions
40 lines (37 loc) · 1.77 KB
/
EstoniaTest.cs
File metadata and controls
40 lines (37 loc) · 1.77 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 EstoniaTest
{
private const string ESTONIA_NAME = "Estonia";
private const int ESTONIA_STATE_COUNT = 15;
private const string ESTONIA_OFFICIAL_NAME = "Republic of Estonia";
private const string ESTONIA_NATIVE_NAME = "Eesti";
private const string ESTONIA_CAPITAL = "Tallinn";
private const int ESTONIA_NUMERIC_CODE = 233;
private const string ESTONIA_ISO2_CODE = "EE";
private const string ESTONIA_ISO3_CODE = "EST";
private readonly string[] ESTONIA_CALLING_CODE = ["372"];
private static readonly string[] VALID_STATE_TYPES = { "County" };
[Fact]
public void GetCountry_ReturnsCorrectInformation_ForEstonia()
{
// Arrange
CountryIdentifier existingCountryId = CountryIdentifier.Estonia;
// Act
var country = CountryProvider.GetCountry(existingCountryId);
// Assert
Assert.Equal(existingCountryId, country.Id);
Assert.Equal(ESTONIA_NAME, country.Name);
Assert.NotNull(country.States);
Assert.Equal(ESTONIA_STATE_COUNT, country.States.Count());
Assert.Equal(ESTONIA_OFFICIAL_NAME, country.OfficialName);
Assert.Equal(ESTONIA_NATIVE_NAME, country.NativeName);
Assert.Equal(ESTONIA_CAPITAL, country.Capital);
Assert.Equal(ESTONIA_NUMERIC_CODE, country.NumericCode);
Assert.Equal(ESTONIA_ISO2_CODE, country.ISO2Code);
Assert.Equal(ESTONIA_ISO3_CODE, country.ISO3Code);
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
Assert.Equal(ESTONIA_CALLING_CODE, country.CallingCode);
}
}
}