-
Notifications
You must be signed in to change notification settings - Fork 3
Add country details for Denmark Djibouti Dominica #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| namespace World.Net.UnitTests.Countries; | ||
| public sealed class DenmarkTest | ||
| { | ||
| private const string DENMARK_NAME = "Denmark"; | ||
| private const int DENMARK_STATE_COUNT = 5; | ||
| private const string DENMARK_OFFICIAL_NAME = "Kingdom of Denmark"; | ||
| private const string DENMARK_NATIVE_NAME = "Danmark"; | ||
| private const string DENMARK_CAPITAL = "Copenhagen"; | ||
| private const int DENMARK_NUMERIC_CODE = 208; | ||
| private const string DENMARK_ISO2_CODE = "DK"; | ||
| private const string DENMARK_ISO3_CODE = "DNK"; | ||
| private readonly string[] DENMARK_CALLING_CODE = ["+45"]; | ||
| private static readonly string[] VALID_STATE_TYPES = { "Region" }; | ||
|
|
||
| [Fact] | ||
| public void GetCountry_ReturnsCorrectInformation_ForDenmark() | ||
| { | ||
| // Arrange | ||
| CountryIdentifier existingCountryId = CountryIdentifier.Denmark; | ||
|
|
||
| // Act | ||
| var country = CountryProvider.GetCountry(existingCountryId); | ||
|
|
||
| //Assert | ||
| Assert.Equal(existingCountryId, country.Id); | ||
| Assert.Equal(DENMARK_NAME, country.Name); | ||
| Assert.NotNull(country.States); | ||
| Assert.Equal(DENMARK_STATE_COUNT, country.States.Count()); | ||
| Assert.Equal(DENMARK_OFFICIAL_NAME, country.OfficialName); | ||
| Assert.Equal(DENMARK_NATIVE_NAME, country.NativeName); | ||
| Assert.Equal(DENMARK_CAPITAL, country.Capital); | ||
| Assert.Equal(DENMARK_NUMERIC_CODE, country.NumericCode); | ||
| Assert.Equal(DENMARK_ISO2_CODE, country.ISO2Code); | ||
| Assert.Equal(DENMARK_ISO3_CODE, country.ISO3Code); | ||
| Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES)); | ||
| Assert.Equal(DENMARK_CALLING_CODE, country.CallingCode); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| namespace World.Net.UnitTests.Countries; | ||
| public sealed class DjiboutiTest | ||
| { | ||
| private const string DJIBOUTI_NAME = "Djibouti"; | ||
| private const int DJIBOUTI_STATE_COUNT = 6; | ||
| private const string DJIBOUTI_OFFICIAL_NAME = "Republic of Djibouti"; | ||
| private const string DJIBOUTI_NATIVE_NAME = "Djibouti"; | ||
| private const string DJIBOUTI_CAPITAL = "Djibouti"; | ||
| private const int DJIBOUTI_NUMERIC_CODE = 262; | ||
| private const string DJIBOUTI_ISO2_CODE = "DJ"; | ||
| private const string DJIBOUTI_ISO3_CODE = "DJI"; | ||
| private static readonly string[] VALID_STATE_TYPES = { "Region", "City" }; | ||
| private readonly string[] DJIBOUTI_CALLING_CODE = ["+253"]; | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No state type test
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved |
||
| [Fact] | ||
| public void GetCountry_ReturnsCorrectInformation_ForDjibouti() | ||
| { | ||
| // Arrange | ||
| CountryIdentifier existingCountryId = CountryIdentifier.Djibouti; | ||
|
|
||
| // Act | ||
| var country = CountryProvider.GetCountry(existingCountryId); | ||
|
|
||
| //Assert | ||
| Assert.Equal(existingCountryId, country.Id); | ||
| Assert.Equal(DJIBOUTI_NAME, country.Name); | ||
| Assert.NotNull(country.States); | ||
| Assert.Equal(DJIBOUTI_STATE_COUNT, country.States.Count()); | ||
| Assert.Equal(DJIBOUTI_OFFICIAL_NAME, country.OfficialName); | ||
| Assert.Equal(DJIBOUTI_NATIVE_NAME, country.NativeName); | ||
| Assert.Equal(DJIBOUTI_CAPITAL, country.Capital); | ||
| Assert.Equal(DJIBOUTI_NUMERIC_CODE, country.NumericCode); | ||
| Assert.Equal(DJIBOUTI_ISO2_CODE, country.ISO2Code); | ||
| Assert.Equal(DJIBOUTI_ISO3_CODE, country.ISO3Code); | ||
| Assert.Equal(DJIBOUTI_CALLING_CODE, country.CallingCode); | ||
| Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES)); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| namespace World.Net.UnitTests.Countries; | ||
| public sealed class DominicaTest | ||
| { | ||
| private const string DOMINICA_NAME = "Dominica"; | ||
| private const int DOMINICA_STATE_COUNT = 10; | ||
| private const string DOMINICA_OFFICIAL_NAME = "Commonwealth of Dominica"; | ||
| private const string DOMINICA_NATIVE_NAME = "Dominica"; | ||
| private const string DOMINICA_CAPITAL = "Roseau"; | ||
| private const int DOMINICA_NUMERIC_CODE = 212; | ||
| private const string DOMINICA_ISO2_CODE = "DM"; | ||
| private const string DOMINICA_ISO3_CODE = "DMA"; | ||
| private static readonly string[] VALID_STATE_TYPES = { "Parish" }; | ||
| private readonly string[] DOMINICA_CALLING_CODE = ["+1-767"]; | ||
|
|
||
| [Fact] | ||
| public void GetCountry_ReturnsCorrectInformation_ForDominica() | ||
| { | ||
| // Arrange | ||
| CountryIdentifier existingCountryId = CountryIdentifier.Dominica; | ||
|
|
||
| // Act | ||
| var country = CountryProvider.GetCountry(existingCountryId); | ||
|
|
||
| //Assert | ||
| Assert.Equal(existingCountryId, country.Id); | ||
| Assert.Equal(DOMINICA_NAME, country.Name); | ||
| Assert.NotNull(country.States); | ||
| Assert.Equal(DOMINICA_STATE_COUNT, country.States.Count()); | ||
| Assert.Equal(DOMINICA_OFFICIAL_NAME, country.OfficialName); | ||
| Assert.Equal(DOMINICA_NATIVE_NAME, country.NativeName); | ||
| Assert.Equal(DOMINICA_CAPITAL, country.Capital); | ||
| Assert.Equal(DOMINICA_NUMERIC_CODE, country.NumericCode); | ||
| Assert.Equal(DOMINICA_ISO2_CODE, country.ISO2Code); | ||
| Assert.Equal(DOMINICA_ISO3_CODE, country.ISO3Code); | ||
| Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES)); | ||
| Assert.Equal(DOMINICA_CALLING_CODE, country.CallingCode); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| namespace World.Net.Countries; | ||
| internal sealed class Denmark : ICountry | ||
| { | ||
| ///<inheritdoc/> | ||
| public CountryIdentifier Id => CountryIdentifier.Denmark; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Name => nameof(Denmark); | ||
|
|
||
| ///<inheritdoc/> | ||
| public string OfficialName { get; } = "Kingdom of Denmark"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string NativeName { get; } = "Danmark"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Capital { get; } = "Copenhagen"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public int NumericCode { get; } = 208; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO2Code { get; } = "DK"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO3Code { get; } = "DNK"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string[] CallingCode { get; } = ["+45"]; | ||
|
|
||
| ///<inheritdoc/> | ||
| public IEnumerable<State> States { get; } = | ||
| [ | ||
| new("Central Denmark", "DK-82", "Region"), | ||
| new("Capital Region of Denmark", "DK-84", "Region"), | ||
| new("North Denmark", "DK-81", "Region"), | ||
| new("Southern Denmark", "DK-83", "Region"), | ||
| new("Zealand", "DK-85", "Region"), | ||
| ]; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. public IEnumerable States { get; } = Denmark isn't part of the list
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| namespace World.Net.Countries; | ||
| internal sealed class Djibouti : ICountry | ||
| { | ||
| ///<inheritdoc/> | ||
| public CountryIdentifier Id => CountryIdentifier.Djibouti; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Name => nameof(Djibouti); | ||
|
|
||
| ///<inheritdoc/> | ||
| public string OfficialName { get; } = "Republic of Djibouti"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string NativeName { get; } = "Djibouti"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Capital { get; } = "Djibouti"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public int NumericCode { get; } = 262; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO2Code { get; } = "DJ"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO3Code { get; } = "DJI"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string[] CallingCode { get; } = ["+253"]; | ||
|
|
||
| ///<inheritdoc/> | ||
| public IEnumerable<State> States { get; } = | ||
| [ | ||
| new("Ali Sabieh", "DJ-AS", "Region"), | ||
| new("Arta", "DJ-AR", "Region"), | ||
| new("Dikhil", "DJ-DI", "Region"), | ||
| new("Djibouti", "DJ-DJ", "City"), | ||
| new("Obock", "DJ-OB", "Region"), | ||
| new("Tadjourah", "DJ-TA", "Region"), | ||
| ]; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| namespace World.Net.Countries; | ||
| internal sealed class Dominica : ICountry | ||
| { | ||
| ///<inheritdoc/> | ||
| public CountryIdentifier Id => CountryIdentifier.Dominica; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Name => nameof(Dominica); | ||
|
|
||
| ///<inheritdoc/> | ||
| public string OfficialName { get; } = "Commonwealth of Dominica"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string NativeName { get; } = "Dominica"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Capital { get; } = "Roseau"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public int NumericCode { get; } = 212; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO2Code { get; } = "DM"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO3Code { get; } = "DMA"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string[] CallingCode { get; } = ["+1-767"]; | ||
|
|
||
| ///<inheritdoc/> | ||
| public IEnumerable<State> States { get; } = | ||
| [ | ||
| new("Saint Andrew", "DM-02", "Parish"), | ||
| new("Saint David", "DM-03", "Parish"), | ||
| new("Saint George", "DM-04", "Parish"), | ||
| new("Saint John", "DM-05", "Parish"), | ||
| new("Saint Joseph", "DM-06", "Parish"), | ||
| new("Saint Luke", "DM-07", "Parish"), | ||
| new("Saint Mark", "DM-08", "Parish"), | ||
| new("Saint Patrick", "DM-09", "Parish"), | ||
| new("Saint Paul", "DM-10", "Parish"), | ||
| new("Saint Peter", "DM-11", "Parish"), | ||
| ]; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No state type test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved