-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBahrainTest.cs
More file actions
40 lines (36 loc) · 1.69 KB
/
BahrainTest.cs
File metadata and controls
40 lines (36 loc) · 1.69 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 BahrainTest
{
private const string BAHRAIN_COUNTRY_NAME = "Bahrain";
private const string BAHRAIN_NATIVE_NAME = "البحرين";
private const string BAHRAIN_CAPITAL = "Manama";
private const string BAHRAIN_OFFICIAL_NAME = "Kingdom of Bahrain";
private const string BAHRAIN_ISO2_CODE = "BH";
private const string BAHRAIN_ISO3_CODE = "BHR";
private const int BAHRAIN_NUMERIC_CODE = 048;
private readonly string[] BAHRAIN_CALLING_CODE = ["+973"];
private const int BAHRAIN_STATE_COUNT = 5;
private static readonly string[] VALID_STATE_TYPES = { "Governorate", };
[Fact]
public void GetCountry_ReturnsCorrectInformation_ForBahrain()
{
// Arrange
CountryIdentifier existingCountryId = CountryIdentifier.Bahrain;
// Act
var country = CountryProvider.GetCountry(existingCountryId);
// Assert
Assert.NotNull(country);
Assert.Equal(existingCountryId, country.Id);
Assert.Equal(BAHRAIN_COUNTRY_NAME, country.Name);
Assert.Equal(BAHRAIN_OFFICIAL_NAME, country.OfficialName);
Assert.Equal(BAHRAIN_NATIVE_NAME, country.NativeName);
Assert.Equal(BAHRAIN_CAPITAL, country.Capital);
Assert.Equal(BAHRAIN_NUMERIC_CODE, country.NumericCode);
Assert.Equal(BAHRAIN_ISO2_CODE, country.ISO2Code);
Assert.Equal(BAHRAIN_ISO3_CODE, country.ISO3Code);
Assert.Equal(BAHRAIN_CALLING_CODE, country.CallingCode);
Assert.NotNull(country.States);
Assert.Equal(BAHRAIN_STATE_COUNT, country.States.Count());
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
}
}