Skip to content

Commit b86bf56

Browse files
committed
Fixed tests to use new structure
1 parent b033fb9 commit b86bf56

36 files changed

+67
-26
lines changed

src/LinkDotNet.Blog.Web/Features/Error.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@page
2-
@model LinkDotNet.Blog.Web.Pages.ErrorModel
2+
@model LinkDotNet.Blog.Web.Features.ErrorModel
33

44
<!DOCTYPE html>
55
<html>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@page
2-
@model LinkDotNet.Blog.Web.Pages.LoginModel
2+
@model LinkDotNet.Blog.Web.Features.LoginModel
33
@{
4-
}
4+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@page
2-
@model LinkDotNet.Blog.Web.Pages.LogoutModel
2+
@model LinkDotNet.Blog.Web.Features.LogoutModel
33
@{
4-
}
4+
}

tests/LinkDotNet.Blog.IntegrationTests/Web/Pages/Admin/CreateNewBlogPostPageTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
using Bunit.TestDoubles;
55
using LinkDotNet.Blog.Domain;
66
using LinkDotNet.Blog.Infrastructure.Persistence;
7+
using LinkDotNet.Blog.Web.Features.Admin.BlogPostEditor;
8+
using LinkDotNet.Blog.Web.Features.Admin.BlogPostEditor.Components;
79
using LinkDotNet.Blog.Web.Features.Admin.BlogPostEditor.Services;
810
using Microsoft.AspNetCore.Components.Forms;
911
using Microsoft.EntityFrameworkCore;
@@ -23,7 +25,7 @@ public async Task ShouldSaveBlogPostOnSave()
2325
ctx.Services.AddScoped(_ => toastService.Object);
2426
ctx.ComponentFactories.AddStub<UploadFile>();
2527
ctx.Services.AddScoped(_ => Mock.Of<IFileProcessor>());
26-
using var cut = ctx.RenderComponent<CreateNewBlogPostPage>();
28+
using var cut = ctx.RenderComponent<CreateBlogPost>();
2729
var newBlogPost = cut.FindComponent<CreateNewBlogPost>();
2830

2931
TriggerNewBlogPost(newBlogPost);

tests/LinkDotNet.Blog.IntegrationTests/Web/Pages/Admin/Dashboard/VisitCountPerPageTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using Bunit;
66
using LinkDotNet.Blog.Domain;
77
using LinkDotNet.Blog.TestUtilities;
8+
using LinkDotNet.Blog.Web.Features.Admin.Dashboard.Components;
9+
using LinkDotNet.Blog.Web.Features.Admin.Dashboard.Services;
810
using Microsoft.Extensions.DependencyInjection;
911

1012
namespace LinkDotNet.Blog.IntegrationTests.Web.Pages.Admin.Dashboard;

tests/LinkDotNet.Blog.IntegrationTests/Web/Pages/Admin/DraftBlogPostPageTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
using LinkDotNet.Blog.Domain;
55
using LinkDotNet.Blog.Infrastructure.Persistence;
66
using LinkDotNet.Blog.TestUtilities;
7+
using LinkDotNet.Blog.Web.Features.Admin.DraftBlogPost;
8+
using LinkDotNet.Blog.Web.Features.Components;
79
using Microsoft.Extensions.DependencyInjection;
810

911
namespace LinkDotNet.Blog.IntegrationTests.Web.Pages.Admin;
@@ -20,12 +22,12 @@ public async Task ShouldOnlyShowPublishedPosts()
2022
using var ctx = new TestContext();
2123
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
2224
ctx.Services.AddScoped<IRepository<BlogPost>>(_ => Repository);
23-
var cut = ctx.RenderComponent<DraftBlogPosts>();
25+
var cut = ctx.RenderComponent<Index>();
2426
cut.WaitForState(() => cut.FindAll(".blog-card").Any());
2527

2628
var blogPosts = cut.FindComponents<ShortBlogPost>();
2729

2830
blogPosts.Should().HaveCount(1);
2931
blogPosts[0].Find(".description h1").InnerHtml.Should().Be("Not published");
3032
}
31-
}
33+
}

tests/LinkDotNet.Blog.IntegrationTests/Web/Pages/Admin/UpdateBlogPostPageTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
using LinkDotNet.Blog.Domain;
77
using LinkDotNet.Blog.Infrastructure.Persistence;
88
using LinkDotNet.Blog.TestUtilities;
9+
using LinkDotNet.Blog.Web.Features.Admin.BlogPostEditor;
10+
using LinkDotNet.Blog.Web.Features.Admin.BlogPostEditor.Components;
911
using Microsoft.EntityFrameworkCore;
1012
using Microsoft.Extensions.DependencyInjection;
1113

tests/LinkDotNet.Blog.IntegrationTests/Web/Pages/IndexTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using LinkDotNet.Blog.Web;
88
using LinkDotNet.Blog.Web.Features.Components;
99
using LinkDotNet.Blog.Web.Features.Home;
10-
using LinkDotNet.Blog.Web.Features.Home.Components;
1110
using LinkDotNet.Blog.Web.Features.Services;
1211
using Microsoft.Extensions.DependencyInjection;
1312

0 commit comments

Comments
 (0)