Skip to content

Commit

Permalink
Fix codeql and sonar warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tjololo committed Oct 13, 2023
1 parent 79101c0 commit b4aeedf
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/Altinn.App.Core.Tests/Internal/App/AppMedataTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,23 +461,19 @@ public async Task GetApplicationMetadata_logo_can_intstantiate_with_source_and_D
actual.Should().NotBeNull();
actual.Should().BeEquivalentTo(expected);
}
[Fact]

[Fact]
public async Task GetApplicationMetadata_deserializes_unmapped_properties()
{
var featureManagerMock = new Mock<IFeatureManager>();
IFrontendFeatures frontendFeatures = new FrontendFeatures(featureManagerMock.Object);
Dictionary<string, bool> enabledFrontendFeatures = await frontendFeatures.GetFrontendFeatures();

AppSettings appSettings = GetAppSettings("AppMetadata", "unmapped-properties.applicationmetadata.json");
IAppMetadata appMetadata = SetupAppMedata(Microsoft.Extensions.Options.Options.Create(appSettings));
IAppMetadata appMetadata = SetupAppMedata(Options.Create(appSettings));
var actual = await appMetadata.GetApplicationMetadata();
actual.Should().NotBeNull();
actual.UnmappedProperties.Should().NotBeNull();
actual.UnmappedProperties!["foo"].Should().BeOfType<JsonElement>();
((JsonElement)actual.UnmappedProperties["foo"]).GetProperty("bar").GetString().Should().Be("baz");
}

[Fact]
public async void GetApplicationMetadata_throws_ApplicationConfigException_if_file_not_found()
{
Expand Down

0 comments on commit b4aeedf

Please sign in to comment.