-
Notifications
You must be signed in to change notification settings - Fork 3
add details for Brazil, British Indian Ocean Territory, Brunei, Bulga… #35
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
Merged
selfmadecode
merged 2 commits into
selfmadecode:main
from
ReaganDev:Brazil-BritishIndianOceanTerritory-Brunei-Bulgaria-and-Burkina-Faso
Feb 22, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| namespace World.Net.UnitTests.Countries | ||
| { | ||
| public sealed class BrazilTest | ||
| { | ||
| private const string BRAZIL_NAME = "Brazil"; | ||
| private const int BRAZIL_STATE_COUNT = 27; | ||
| private const string BRAZIL_OFFICIAL_NAME = "Federative Republic of Brazil"; | ||
| private const string BRAZIL_NATIVE_NAME = "Brasil"; | ||
| private const string BRAZIL_CAPITAL = "Brasilia"; | ||
| private const int BRAZIL_NUMERIC_CODE = 076; | ||
| private const string BRAZIL_ISO2_CODE = "BR"; | ||
| private const string BRAZIL_ISO3_CODE = "BRA"; | ||
| private const string BRAZIL_CALLING_CODE = "+55"; | ||
|
|
||
| [Fact] | ||
| public void GetCountry_ReturnsCorrectInformation_for_Brazil() | ||
| { | ||
| // Arrange | ||
| int existingCountryId = CountryIdentifier.Brazil; | ||
|
|
||
| // Act | ||
| var country = CountryProvider.GetCountry(existingCountryId); | ||
|
|
||
| //Assert | ||
| Assert.Equal(existingCountryId, country.Id); | ||
| Assert.Equal(BRAZIL_NAME, country.Name); | ||
| Assert.NotNull(country.States); | ||
| Assert.Equal(BRAZIL_STATE_COUNT, country.States.Count()); | ||
| Assert.Equal(BRAZIL_OFFICIAL_NAME, country.OfficialName); | ||
| Assert.Equal(BRAZIL_NATIVE_NAME, country.NativeName); | ||
| Assert.Equal(BRAZIL_CAPITAL, country.Capital); | ||
| Assert.Equal(BRAZIL_NUMERIC_CODE, country.NumericCode); | ||
| Assert.Equal(BRAZIL_ISO2_CODE, country.ISO2Code); | ||
| Assert.Equal(BRAZIL_ISO3_CODE, country.ISO3Code); | ||
| Assert.Equal(BRAZIL_CALLING_CODE, country.CallingCode); | ||
| } | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
src/World.Net.UnitTests/Countries/BritishIndianOceanTerritoryTest.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| namespace World.Net.UnitTests.Countries | ||
| { | ||
| public sealed class BritishIndianOceanTerritoryTest | ||
| { | ||
| private const string BRITISH_INDIAN_OCEAN_TERRITORY_NAME = "British Indian Ocean Territory"; | ||
| private const string BRITISH_INDIAN_OCEAN_TERRITORY_OFFICIAL_NAME = "British Indian Ocean Territory"; | ||
| private const string BRITISH_INDIAN_OCEAN_TERRITORY_NATIVE_NAME = "British Indian Ocean Territory"; | ||
| private const string BRITISH_INDIAN_OCEAN_TERRITORY_CAPITAL = "Diego Garcia"; | ||
| private const int BRITISH_INDIAN_OCEAN_TERRITORY_NUMERIC_CODE = 086; | ||
| private const string BRITISH_INDIAN_OCEAN_TERRITORY_ISO2_CODE = "IO"; | ||
| private const string BRITISH_INDIAN_OCEAN_TERRITORY_ISO3_CODE = "IOT"; | ||
| private const string BRITISH_INDIAN_OCEAN_TERRITORY_CALLING_CODE = "+246"; | ||
|
|
||
| [Fact] | ||
| public void GetCountry_ReturnsCorrectInformation_for_BritishIndianOceanTerritory() | ||
| { | ||
| // Arrange | ||
| int existingCountryId = CountryIdentifier.BritishIndianOceanTerritory; | ||
|
|
||
| // Act | ||
| var country = CountryProvider.GetCountry(existingCountryId); | ||
|
|
||
| //Assert | ||
| Assert.Equal(existingCountryId, country.Id); | ||
| Assert.Equal(BRITISH_INDIAN_OCEAN_TERRITORY_NAME, country.Name); | ||
| Assert.NotNull(country.States); | ||
| Assert.Empty(country.States); | ||
| Assert.Equal(BRITISH_INDIAN_OCEAN_TERRITORY_OFFICIAL_NAME, country.OfficialName); | ||
| Assert.Equal(BRITISH_INDIAN_OCEAN_TERRITORY_NATIVE_NAME, country.NativeName); | ||
| Assert.Equal(BRITISH_INDIAN_OCEAN_TERRITORY_CAPITAL, country.Capital); | ||
| Assert.Equal(BRITISH_INDIAN_OCEAN_TERRITORY_NUMERIC_CODE, country.NumericCode); | ||
| Assert.Equal(BRITISH_INDIAN_OCEAN_TERRITORY_ISO2_CODE, country.ISO2Code); | ||
| Assert.Equal(BRITISH_INDIAN_OCEAN_TERRITORY_ISO3_CODE, country.ISO3Code); | ||
| Assert.Equal(BRITISH_INDIAN_OCEAN_TERRITORY_CALLING_CODE, country.CallingCode); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| namespace World.Net.UnitTests.Countries | ||
| { | ||
| public sealed class BruneiTest | ||
| { | ||
| private const string BRUNEI_NAME = "Brunei"; | ||
| private const int BRUNEI_STATE_COUNT = 4; | ||
| private const string BRUNEI_OFFICIAL_NAME = "Nation of Brunei, the Abode of Peace"; | ||
| private const string BRUNEI_NATIVE_NAME = "Negara Brunei Darussalam"; | ||
| private const string BRUNEI_CAPITAL = "Bandar Seri Begawan"; | ||
| private const int BRUNEI_NUMERIC_CODE = 096; | ||
| private const string BRUNEI_ISO2_CODE = "BN"; | ||
| private const string BRUNEI_ISO3_CODE = "BRN"; | ||
| private const string BRUNEI_CALLING_CODE = "+673"; | ||
|
|
||
| [Fact] | ||
| public void GetCountry_ReturnsCorrectInformation_for_Brunei() | ||
| { | ||
| // Arrange | ||
| int existingCountryId = CountryIdentifier.Brunei; | ||
|
|
||
| // Act | ||
| var country = CountryProvider.GetCountry(existingCountryId); | ||
|
|
||
| //Assert | ||
| Assert.Equal(existingCountryId, country.Id); | ||
| Assert.Equal(BRUNEI_NAME, country.Name); | ||
| Assert.NotNull(country.States); | ||
| Assert.Equal(BRUNEI_STATE_COUNT, country.States.Count()); | ||
| Assert.Equal(BRUNEI_OFFICIAL_NAME, country.OfficialName); | ||
| Assert.Equal(BRUNEI_NATIVE_NAME, country.NativeName); | ||
| Assert.Equal(BRUNEI_CAPITAL, country.Capital); | ||
| Assert.Equal(BRUNEI_NUMERIC_CODE, country.NumericCode); | ||
| Assert.Equal(BRUNEI_ISO2_CODE, country.ISO2Code); | ||
| Assert.Equal(BRUNEI_ISO3_CODE, country.ISO3Code); | ||
| Assert.Equal(BRUNEI_CALLING_CODE, country.CallingCode); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| namespace World.Net.UnitTests.Countries | ||
| { | ||
| public sealed class BulgariaTest | ||
| { | ||
| private const string BULGARIA_NAME = "Bulgaria"; | ||
| private const int BULGARIA_STATE_COUNT = 28; | ||
| private const string BULGARIA_OFFICIAL_NAME = "Republic of Bulgaria"; | ||
| private const string BULGARIA_NATIVE_NAME = "България"; | ||
| private const string BULGARIA_CAPITAL = "Sofia"; | ||
| private const int BULGARIA_NUMERIC_CODE = 100; | ||
| private const string BULGARIA_ISO2_CODE = "BG"; | ||
| private const string BULGARIA_ISO3_CODE = "BGR"; | ||
| private const string BULGARIA_CALLING_CODE = "+359"; | ||
|
|
||
| [Fact] | ||
| public void GetCountry_ReturnsCorrectInformation_for_Bulgaria() | ||
| { | ||
| // Arrange | ||
| int existingCountryId = CountryIdentifier.Bulgaria; | ||
|
|
||
| // Act | ||
| var country = CountryProvider.GetCountry(existingCountryId); | ||
|
|
||
| //Assert | ||
| Assert.Equal(existingCountryId, country.Id); | ||
| Assert.Equal(BULGARIA_NAME, country.Name); | ||
| Assert.NotNull(country.States); | ||
| Assert.Equal(BULGARIA_STATE_COUNT, country.States.Count()); | ||
| Assert.Equal(BULGARIA_OFFICIAL_NAME, country.OfficialName); | ||
| Assert.Equal(BULGARIA_NATIVE_NAME, country.NativeName); | ||
| Assert.Equal(BULGARIA_CAPITAL, country.Capital); | ||
| Assert.Equal(BULGARIA_NUMERIC_CODE, country.NumericCode); | ||
| Assert.Equal(BULGARIA_ISO2_CODE, country.ISO2Code); | ||
| Assert.Equal(BULGARIA_ISO3_CODE, country.ISO3Code); | ||
| Assert.Equal(BULGARIA_CALLING_CODE, country.CallingCode); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| namespace World.Net.UnitTests.Countries | ||
| { | ||
| public sealed class BurkinaFasoTest | ||
| { | ||
| private const string BURKINA_FASO_NAME = "Burkina Faso"; | ||
| private const int BURKINA_FASO_STATE_COUNT = 57; | ||
| private const string BURKINA_FASO_OFFICIAL_NAME = "The Republic of Burkina Faso"; | ||
| private const string BURKINA_FASO_NATIVE_NAME = "Burkina Faso"; | ||
| private const string BURKINA_FASO_CAPITAL = "Ouagadougou"; | ||
| private const int BURKINA_FASO_NUMERIC_CODE = 854; | ||
| private const string BURKINA_FASO_ISO2_CODE = "BF"; | ||
| private const string BURKINA_FASO_ISO3_CODE = "BFA"; | ||
| private const string BURKINA_FASO_CALLING_CODE = "+226"; | ||
|
|
||
| [Fact] | ||
| public void GetCountry_ReturnsCorrectInformation_for_BurkinaFaso() | ||
| { | ||
| // Arrange | ||
| int existingCountryId = CountryIdentifier.BurkinaFaso; | ||
|
|
||
| // Act | ||
| var country = CountryProvider.GetCountry(existingCountryId); | ||
|
|
||
| //Assert | ||
| Assert.Equal(existingCountryId, country.Id); | ||
| Assert.Equal(BURKINA_FASO_NAME, country.Name); | ||
| Assert.NotNull(country.States); | ||
| Assert.Equal(BURKINA_FASO_STATE_COUNT, country.States.Count()); | ||
| Assert.Equal(BURKINA_FASO_OFFICIAL_NAME, country.OfficialName); | ||
| Assert.Equal(BURKINA_FASO_NATIVE_NAME, country.NativeName); | ||
| Assert.Equal(BURKINA_FASO_CAPITAL, country.Capital); | ||
| Assert.Equal(BURKINA_FASO_NUMERIC_CODE, country.NumericCode); | ||
| Assert.Equal(BURKINA_FASO_ISO2_CODE, country.ISO2Code); | ||
| Assert.Equal(BURKINA_FASO_ISO3_CODE, country.ISO3Code); | ||
| Assert.Equal(BURKINA_FASO_CALLING_CODE, country.CallingCode); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| namespace World.Net.Countries | ||
| { | ||
| internal sealed class Brazil : ICountry | ||
| { | ||
| ///<inheritdoc/> | ||
| public int Id => CountryIdentifier.Brazil; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Name => nameof(Brazil); | ||
|
|
||
| ///<inheritdoc/> | ||
| public string OfficialName { get; } = "Federative Republic of Brazil"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string NativeName { get; } = "Brasil"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Capital { get; } = "Brasilia"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public int NumericCode { get; } = 076; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO2Code { get; } = "BR"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO3Code { get; } = "BRA"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string CallingCode { get; } = "+55"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public IEnumerable<State> States { get; } = | ||
| [ | ||
| new("Acre", "AC", "State"), | ||
| new("Alagoas", "AL", "State"), | ||
| new("Amapá", "AP", "State"), | ||
| new("Amazonas", "AM", "State"), | ||
| new("Bahia", "BA", "State"), | ||
| new("Ceará", "CE", "State"), | ||
| new("Distrito Federal", "DF", "Federal District"), | ||
| new("Espírito Santo", "ES", "State"), | ||
| new("Goiás", "GO", "State"), | ||
| new("Maranhão", "MA", "State"), | ||
| new("Mato Grosso", "MT", "State"), | ||
| new("Mato Grosso do Sul", "MS", "State"), | ||
| new("Minas Gerais", "MG", "State"), | ||
| new("Pará", "PA", "State"), | ||
| new("Paraíba", "PB", "State"), | ||
| new("Paraná", "PR", "State"), | ||
| new("Pernambuco", "PE", "State"), | ||
| new("Piauí", "PI", "State"), | ||
| new("Rio de Janeiro", "RJ", "State"), | ||
| new("Rio Grande do Norte", "RN", "State"), | ||
| new("Rio Grande do Sul", "RS", "State"), | ||
| new("Rondônia", "RO", "State"), | ||
| new("Roraima", "RR", "State"), | ||
| new("Santa Catarina", "SC", "State"), | ||
| new("São Paulo", "SP", "State"), | ||
| new("Sergipe", "SE", "State"), | ||
| new("Tocantins", "TO", "State"), | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| namespace World.Net.Countries | ||
| { | ||
| internal sealed class BritishIndianOceanTerritory : ICountry | ||
| { | ||
| ///<inheritdoc/> | ||
| public int Id => CountryIdentifier.BritishIndianOceanTerritory; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Name => "British Indian Ocean Territory"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string OfficialName { get; } = "British Indian Ocean Territory"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string NativeName { get; } = "British Indian Ocean Territory"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Capital { get; } = "Diego Garcia"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public int NumericCode { get; } = 086; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO2Code { get; } = "IO"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO3Code { get; } = "IOT"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string CallingCode { get; } = "+246"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public IEnumerable<State> States { get; } = | ||
| [ | ||
|
|
||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| namespace World.Net.Countries | ||
| { | ||
| internal sealed class Brunei : ICountry | ||
| { | ||
| ///<inheritdoc/> | ||
| public int Id => CountryIdentifier.Brunei; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Name => nameof(Brunei); | ||
|
|
||
| ///<inheritdoc/> | ||
| public string OfficialName { get; } = "Nation of Brunei, the Abode of Peace"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string NativeName { get; } = "Negara Brunei Darussalam"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string Capital { get; } = "Bandar Seri Begawan"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public int NumericCode { get; } = 096; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO2Code { get; } = "BN"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string ISO3Code { get; } = "BRN"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public string CallingCode { get; } = "+673"; | ||
|
|
||
| ///<inheritdoc/> | ||
| public IEnumerable<State> States { get; } = | ||
| [ | ||
| new("Belait", "BE", "District"), | ||
| new("Brunei-Muara", "BM", "District"), | ||
| new("Temburong", "TE", "District"), | ||
| new("Tutong", "TU", "District"), | ||
| ]; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
remove this extra space
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.
comment treated