forked from selfmadecode/world.net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrenchPolynesiaTest.cs
More file actions
39 lines (35 loc) · 1.84 KB
/
FrenchPolynesiaTest.cs
File metadata and controls
39 lines (35 loc) · 1.84 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
namespace World.Net.UnitTests.Countries;
public sealed class FrenchPolynesiaTest
{
private const string FRENCH_POLYNESIA_NAME = "French Polynesia";
private const int FRENCH_POLYNESIA_STATE_COUNT = 5;
private const string FRENCH_POLYNESIA_OFFICIAL_NAME = "Polynésie française";
private const string FRENCH_POLYNESIA_NATIVE_NAME = "Polynésie française";
private const string FRENCH_POLYNESIA_CAPITAL = "Papeete";
private const int FRENCH_POLYNESIA_NUMERIC_CODE = 258;
private const string FRENCH_POLYNESIA_ISO2_CODE = "PF";
private const string FRENCH_POLYNESIA_ISO3_CODE = "PYF";
private static readonly string[] VALID_STATE_TYPES = { "division" };
private readonly string[] FRENCH_POLYNESIA_CALLING_CODE = ["+689"];
[Fact]
public void GetCountry_ReturnsCorrectInformation_ForFrench_Polynesia()
{
// Arrange
CountryIdentifier existingCountryId = CountryIdentifier.FrenchPolynesia;
// Act
var country = CountryProvider.GetCountry(existingCountryId);
//Assert
Assert.Equal(existingCountryId, country.Id);
Assert.Equal(FRENCH_POLYNESIA_NAME, country.Name);
Assert.NotNull(country.States);
Assert.Equal(FRENCH_POLYNESIA_STATE_COUNT, country.States.Count());
Assert.Equal(FRENCH_POLYNESIA_OFFICIAL_NAME, country.OfficialName);
Assert.Equal(FRENCH_POLYNESIA_NATIVE_NAME, country.NativeName);
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
Assert.Equal(FRENCH_POLYNESIA_CAPITAL, country.Capital);
Assert.Equal(FRENCH_POLYNESIA_NUMERIC_CODE, country.NumericCode);
Assert.Equal(FRENCH_POLYNESIA_ISO2_CODE, country.ISO2Code);
Assert.Equal(FRENCH_POLYNESIA_ISO3_CODE, country.ISO3Code);
Assert.Equal(FRENCH_POLYNESIA_CALLING_CODE, country.CallingCode);
}
}