Skip to content

Commit

Permalink
use the const instead of magic strings
Browse files Browse the repository at this point in the history
  • Loading branch information
HauklandJ committed Oct 4, 2024
1 parent 935b870 commit 10fa3e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class AltinnApiJsonFormatterTests
public void CreateFormatter_WhenEncoderIsNull_SetsUnsafeRelaxedJsonEscaping()
{
// Arrange
string settingsName = "AltinnApi";
string settingsName = JsonSettingNames.AltinnApi;
var serializerOptions = new JsonSerializerOptions
{
Encoder = null,
Expand All @@ -35,7 +35,7 @@ public void CreateFormatter_WhenEncoderIsNull_SetsUnsafeRelaxedJsonEscaping()
public void CreateFormatter_WhenEncoderIsNotNull_PreservesEncoder()
{
// Arrange
string settingsName = "AltinnApi";
string settingsName = JsonSettingNames.AltinnApi;
var originalEncoder = JavaScriptEncoder.Default;
var serializerOptions = new JsonSerializerOptions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Metadata;
using Altinn.App.Api.Controllers.Attributes;
using Altinn.App.Api.Controllers.Conventions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Formatters;
Expand All @@ -14,7 +15,7 @@ public class ConfigureMvcJsonOptionsTests
public void Configure_InsertsCustomFormatterWithCorrectSettings()
{
// Arrange
var jsonSettingsName = "AltinnApi";
var jsonSettingsName = JsonSettingNames.AltinnApi;
var configureOptions = new ConfigureMvcJsonOptions(jsonSettingsName);
var mvcOptions = new MvcOptions();

Expand Down

0 comments on commit 10fa3e1

Please sign in to comment.