forked from selfmadecode/world.net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChinaTest.cs
More file actions
38 lines (35 loc) · 1.56 KB
/
ChinaTest.cs
File metadata and controls
38 lines (35 loc) · 1.56 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
namespace World.Net.UnitTests.Countries
{
public sealed class ChinaTest
{
private const string CHINA_NAME = "China";
private const int CHINA_STATE_COUNT = 34;
private const string CHINA_OFFICIAL_NAME = "People's Republic of China";
private const string CHINA_NATIVE_NAME = "中国";
private const string CHINA_CAPITAL = "Beijing";
private const int CHINA_NUMERIC_CODE = 156;
private const string CHINA_ISO2_CODE = "CN";
private const string CHINA_ISO3_CODE = "CHN";
private const string CHINA_CALLING_CODE = "+86";
[Fact]
public void GetCountry_ReturnsCorrectInformation_ForChina()
{
// Arrange
CountryIdentifier existingCountryId = CountryIdentifier.China;
// Act
var country = CountryProvider.GetCountry(existingCountryId);
//Assert
Assert.Equal(existingCountryId, country.Id);
Assert.Equal(CHINA_NAME, country.Name);
Assert.NotNull(country.States);
Assert.Equal(CHINA_STATE_COUNT, country.States.Count());
Assert.Equal(CHINA_OFFICIAL_NAME, country.OfficialName);
Assert.Equal(CHINA_NATIVE_NAME, country.NativeName);
Assert.Equal(CHINA_CAPITAL, country.Capital);
Assert.Equal(CHINA_NUMERIC_CODE, country.NumericCode);
Assert.Equal(CHINA_ISO2_CODE, country.ISO2Code);
Assert.Equal(CHINA_ISO3_CODE, country.ISO3Code);
Assert.Equal(CHINA_CALLING_CODE, country.CallingCode);
}
}
}