Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Umbraco.Core/Configuration/Models/DeliveryApiSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public class AuthorizationCodeFlowSettings
/// <value>
/// The URLs allowed as redirect targets.
/// </value>
public ISet<Uri> LoginRedirectUrls { get; set; } = new HashSet<Uri>();
public IEnumerable<Uri> LoginRedirectUrls { get; set; } = [];

/// <summary>
/// Gets or sets the URLs allowed to use as redirect targets after a successful logout (session termination).
Expand All @@ -155,7 +155,7 @@ public class AuthorizationCodeFlowSettings
/// <remarks>
/// These are only required if logout is to be used.
/// </remarks>
public ISet<Uri> LogoutRedirectUrls { get; set; } = new HashSet<Uri>();
public IEnumerable<Uri> LogoutRedirectUrls { get; set; } = [];
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ public class RequestHandlerSettings
/// <summary>
/// Add additional character replacements, or override defaults
/// </summary>
public ISet<CharItem> UserDefinedCharCollection { get; set; } = new HashSet<CharItem>();
public IEnumerable<CharItem> UserDefinedCharCollection { get; set; } = [];
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Linq;
using NUnit.Framework;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Extensions;
Expand All @@ -14,10 +13,10 @@ public void Given_CharCollection_With_DefaultEnabled_MergesCollection()
var settings = new RequestHandlerSettings
{
UserDefinedCharCollection =
{
[
new() { Char = "test", Replacement = "replace" },
new() { Char = "test2", Replacement = "replace2" },
}
]
};
var actual = settings.GetCharReplacements().ToList();

Expand All @@ -34,15 +33,15 @@ public void Given_CharCollection_With_DefaultDisabled_ReturnsUserCollection()
var settings = new RequestHandlerSettings
{
UserDefinedCharCollection =
{
[
new() { Char = "test", Replacement = "replace" },
new() { Char = "test2", Replacement = "replace2" },
},
],
EnableDefaultCharReplacements = false,
};
var actual = settings.GetCharReplacements().ToList();

Assert.AreEqual(settings.UserDefinedCharCollection.Count, actual.Count);
Assert.AreEqual(settings.UserDefinedCharCollection.Count(), actual.Count);
Assert.That(actual, Is.EquivalentTo(settings.UserDefinedCharCollection));
}

Expand All @@ -52,10 +51,10 @@ public void Given_CharCollection_That_OverridesDefaultValues_ReturnsReplacements
var settings = new RequestHandlerSettings
{
UserDefinedCharCollection =
{
[
new() { Char = "%", Replacement = "percent" },
new() { Char = ".", Replacement = "dot" },
}
]
};
var actual = settings.GetCharReplacements().ToList();

Expand All @@ -73,11 +72,11 @@ public void Given_CharCollection_That_OverridesDefaultValues_And_ContainsNew_Ret
var settings = new RequestHandlerSettings
{
UserDefinedCharCollection =
{
[
new() { Char = "%", Replacement = "percent" },
new() { Char = ".", Replacement = "dot" },
new() { Char = "new", Replacement = "new" },
}
]
};
var actual = settings.GetCharReplacements().ToList();

Expand Down