diff --git a/HrynCo.NotificationService.Web.IntegrationTests/AdminTemplatesIndexViewTests.cs b/HrynCo.NotificationService.Web.IntegrationTests/AdminTemplatesIndexViewTests.cs new file mode 100644 index 0000000..65f2ce2 --- /dev/null +++ b/HrynCo.NotificationService.Web.IntegrationTests/AdminTemplatesIndexViewTests.cs @@ -0,0 +1,32 @@ +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"); + } +} diff --git a/HrynCo.NotificationService.Web.IntegrationTests/UnitTest1.cs b/HrynCo.NotificationService.Web.IntegrationTests/UnitTest1.cs deleted file mode 100644 index 3e48a76..0000000 --- a/HrynCo.NotificationService.Web.IntegrationTests/UnitTest1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace HrynCo.NotificationService.Web.IntegrationTests; - -public class UnitTest1 -{ - [Fact] - public void Test1() - { - - } -} diff --git a/HrynCo.NotificationService.Web/Views/AdminTemplates/Index.cshtml b/HrynCo.NotificationService.Web/Views/AdminTemplates/Index.cshtml index 20907cb..69cecfc 100644 --- a/HrynCo.NotificationService.Web/Views/AdminTemplates/Index.cshtml +++ b/HrynCo.NotificationService.Web/Views/AdminTemplates/Index.cshtml @@ -14,7 +14,7 @@
@@ -146,7 +146,7 @@ else