-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBermudaTest.cs
More file actions
46 lines (39 loc) · 1.73 KB
/
BermudaTest.cs
File metadata and controls
46 lines (39 loc) · 1.73 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
41
42
43
44
45
namespace World.Net.UnitTests.Countries;
public class BermudaTestData
{
internal const string COUNTRY_NAME = "Bermuda";
internal const string NATIVE_NAME = "Bermuda";
internal const string CAPITAL = "Hamilton";
internal const string OFFICIAL_NAME = "Bermuda";
internal const string ISO2_CODE = "BM";
internal const string ISO3_CODE = "BMU";
internal const int NUMERIC_CODE = 60;
internal static readonly string[] CALLING_CODE = ["+1-441"];
internal const string STATE_TYPE = "Municipality";
internal const int EXPECTED_STATE_COUNT = 9;
}
public sealed class BermudaTest
{
[Fact]
public void GetCountry_ReturnsCorrectInformation_ForBermuda()
{
// Arrange
CountryIdentifier existingCountryId = CountryIdentifier.Bermuda;
// Act
var country = CountryProvider.GetCountry(existingCountryId);
// Assert
Assert.NotNull(country);
Assert.Equal(existingCountryId, country.Id);
Assert.Equal(BermudaTestData.COUNTRY_NAME, country.Name);
Assert.Equal(BermudaTestData.OFFICIAL_NAME, country.OfficialName);
Assert.Equal(BermudaTestData.NATIVE_NAME, country.NativeName);
Assert.Equal(BermudaTestData.CAPITAL, country.Capital);
Assert.Equal(BermudaTestData.NUMERIC_CODE, country.NumericCode);
Assert.Equal(BermudaTestData.ISO2_CODE, country.ISO2Code);
Assert.Equal(BermudaTestData.ISO3_CODE, country.ISO3Code);
Assert.Equal(BermudaTestData.CALLING_CODE, country.CallingCode);
Assert.NotNull(country.States);
Assert.Equal(BermudaTestData.EXPECTED_STATE_COUNT, country.States.Count());
Assert.All(country.States, state => Assert.Equal(BermudaTestData.STATE_TYPE, state.Type));
}
}