Files
hrynco-notification-service/HrynCo.NotificationService.Web.IntegrationTests/AdminTemplatesIndexViewTests.cs
T
agrynco 1ceb71b9a2 fix: correct notification template filter links
Use explicit Razor interpolation for create and edit URLs and cover the rendered link syntax with a regression test.

Ref: IT-1039
2026-08-04 21:01:46 +03:00

33 lines
1.0 KiB
C#

namespace HrynCo.NotificationService.Web.IntegrationTests;
public sealed class AdminTemplatesIndexViewTests
{
[Fact]
public void CreateAndEditLinks_UseExplicitFilterQueryInterpolation()
{
string view = File.ReadAllText(FindIndexView());
Assert.Contains("/admin/templates/create@(filterQuery)", view);
Assert.Contains("@t.LanguageCode@(filterQuery)", view);
Assert.DoesNotContain("create@filterQuery", view);
Assert.DoesNotContain("LanguageCode@filterQuery", view);
}
private static string FindIndexView()
{
DirectoryInfo? directory = new(AppContext.BaseDirectory);
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "HrynCo.NotificationService.slnx")))
{
directory = directory.Parent;
}
Assert.NotNull(directory);
return Path.Combine(
directory.FullName,
"HrynCo.NotificationService.Web",
"Views",
"AdminTemplates",
"Index.cshtml");
}
}