-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for communes and refactor to generic classification codel…
…ist provider.
- Loading branch information
Ronny Birkeli
committed
Mar 4, 2023
1 parent
ad6a6cd
commit 2972897
Showing
17 changed files
with
4,016 additions
and
158 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
27 changes: 0 additions & 27 deletions
27
src/Altinn.Codelists/SSB/IndustryGroupingCodelistProvider.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
22 changes: 22 additions & 0 deletions
22
test/Altinn.Codelists.Tests/SSB/CommunesCodelistProviderTests.cs
This file contains 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,22 @@ | ||
using Altinn.App.Core.Features; | ||
using Altinn.Codelists.SSB; | ||
using Altinn.Codelists.SSB.Clients; | ||
using Altinn.Codelists.SSB.Models; | ||
using Altinn.Codelists.Tests.SSB.Mocks; | ||
|
||
namespace Altinn.Codelists.Tests.SSB; | ||
|
||
public class CommunesCodelistProviderTests | ||
{ | ||
[Fact] | ||
public async Task GetAppOptionsAsync_ShouldReturnListOfCodes() | ||
{ | ||
var httpClientMock = new ClassificationsHttpClientMock(Options.Create(new ClassificationSettings())); | ||
IAppOptionsProvider appOptionsProvider = new ClassificationCodelistProvider("kommuner", Classification.Communes, httpClientMock); | ||
|
||
var appOptions = await appOptionsProvider.GetAppOptionsAsync("nb", new Dictionary<string, string>()); | ||
|
||
appOptions.Options.Should().HaveCount(357); | ||
appOptions.Options.First(x => x.Value == "4640").Label.Should().Be("Sogndal"); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
test/Altinn.Codelists.Tests/SSB/CountiesCodelistProviderTests.cs
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.