From 0982db36961926a084c69c73d0e21dd08af5f35f Mon Sep 17 00:00:00 2001 From: Steven Giesel Date: Thu, 28 Dec 2023 19:21:00 +0100 Subject: [PATCH] cleanup --- .../Web/Features/Admin/DraftBlogPost/DraftBlogPostPageTests.cs | 1 - .../Web/Features/Home/IndexTests.cs | 2 -- .../Web/Features/Search/SearchPageTests.cs | 2 -- .../Web/Features/SearchByTag/SearchByTagPageTests.cs | 3 --- .../Web/Features/AboutMe/AboutMePageTests.cs | 1 - 5 files changed, 9 deletions(-) diff --git a/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Admin/DraftBlogPost/DraftBlogPostPageTests.cs b/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Admin/DraftBlogPost/DraftBlogPostPageTests.cs index 70749aa9..e870458a 100644 --- a/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Admin/DraftBlogPost/DraftBlogPostPageTests.cs +++ b/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Admin/DraftBlogPost/DraftBlogPostPageTests.cs @@ -20,7 +20,6 @@ public async Task ShouldOnlyShowPublishedPosts() using var ctx = new TestContext(); ctx.JSInterop.Mode = JSRuntimeMode.Loose; ctx.Services.AddScoped(_ => Repository); - ctx.Services.AddMemoryCache(); var cut = ctx.RenderComponent(); cut.WaitForState(() => cut.FindAll(".blog-card").Any()); diff --git a/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Home/IndexTests.cs b/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Home/IndexTests.cs index 3b27c7ca..d33e3b5e 100644 --- a/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Home/IndexTests.cs +++ b/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Home/IndexTests.cs @@ -168,7 +168,5 @@ private void RegisterComponents(TestContextBase ctx, string profilePictureUri = ctx.Services.AddScoped(_ => Repository); ctx.Services.AddScoped(_ => Options.Create(CreateSampleAppConfiguration(profilePictureUri).ApplicationConfiguration)); ctx.Services.AddScoped(_ => Options.Create(CreateSampleAppConfiguration(profilePictureUri).Introduction)); - ctx.Services.AddScoped(_ => Substitute.For()); - ctx.Services.AddMemoryCache(); } } diff --git a/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Search/SearchPageTests.cs b/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Search/SearchPageTests.cs index 81e92078..f64b7d91 100644 --- a/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Search/SearchPageTests.cs +++ b/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Search/SearchPageTests.cs @@ -66,7 +66,5 @@ public async Task ShouldUnescapeQuery() private void RegisterServices(TestContext ctx) { ctx.Services.AddScoped(_ => Repository); - ctx.Services.AddScoped(_ => Substitute.For()); - ctx.Services.AddMemoryCache(); } } diff --git a/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/SearchByTag/SearchByTagPageTests.cs b/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/SearchByTag/SearchByTagPageTests.cs index 6a6486db..a922ff11 100644 --- a/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/SearchByTag/SearchByTagPageTests.cs +++ b/tests/LinkDotNet.Blog.IntegrationTests/Web/Features/SearchByTag/SearchByTagPageTests.cs @@ -48,7 +48,6 @@ public void ShouldSetTitleToTag() { using var ctx = new TestContext(); ctx.Services.AddScoped(_ => Repository); - ctx.Services.AddScoped(_ => Substitute.For()); ctx.ComponentFactories.AddStub(); var cut = ctx.RenderComponent(p => p.Add(s => s.Tag, "Tag")); @@ -68,7 +67,5 @@ private async Task AddBlogPostWithTagAsync(string tag, bool isPublished = true) private void RegisterServices(TestContext ctx) { ctx.Services.AddScoped(_ => Repository); - ctx.Services.AddScoped(_ => Substitute.For()); - ctx.Services.AddMemoryCache(); } } diff --git a/tests/LinkDotNet.Blog.UnitTests/Web/Features/AboutMe/AboutMePageTests.cs b/tests/LinkDotNet.Blog.UnitTests/Web/Features/AboutMe/AboutMePageTests.cs index 8324a8ec..7cd9e0b5 100644 --- a/tests/LinkDotNet.Blog.UnitTests/Web/Features/AboutMe/AboutMePageTests.cs +++ b/tests/LinkDotNet.Blog.UnitTests/Web/Features/AboutMe/AboutMePageTests.cs @@ -82,7 +82,6 @@ private void SetupMocks(ProfileInformation config, ApplicationConfiguration appl { Services.AddScoped(_ => Options.Create(config)); Services.AddScoped(_ => Options.Create(applicationConfiguration)); - Services.AddScoped(_ => Substitute.For()); Services.AddScoped(_ => Substitute.For()); Services.RegisterRepositoryWithEmptyReturn(); Services.RegisterRepositoryWithEmptyReturn();