File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
src/LinkDotNet.Blog.Web/Shared
tests/LinkDotNet.Blog.IntegrationTests/Web/Pages Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 16
16
<li ><h6 class =" dropdown-header" >Others</h6 ></li >
17
17
<li ><a class =" dropdown-item" href =" Sitemap" >Sitemap</a ></li >
18
18
<li ><hr class =" dropdown-divider" ></li >
19
- <li ><a class =" dropdown-item" target =" _blank" href =" https://github.com/linkdotnet/Blog/releases" >Version 3.1 </a ></li >
19
+ <li ><a class =" dropdown-item" target =" _blank" href =" https://github.com/linkdotnet/Blog/releases" >Version 3.2 </a ></li >
20
20
</ul >
21
21
</li >
22
22
<li class =" nav-item" ><a class =" nav-link" href =" logout?redirectUri=@CurrentUri" >Log out</a ></li >
Original file line number Diff line number Diff line change 2
2
using System . Linq ;
3
3
using System . Threading . Tasks ;
4
4
using Bunit ;
5
+ using Bunit . TestDoubles ;
5
6
using LinkDotNet . Blog . Domain ;
6
7
using LinkDotNet . Blog . Infrastructure . Persistence ;
7
8
using LinkDotNet . Blog . TestUtilities ;
8
9
using LinkDotNet . Blog . Web . Pages ;
9
10
using LinkDotNet . Blog . Web . Shared . Services ;
11
+ using Microsoft . AspNetCore . Components . Web ;
10
12
using Microsoft . Extensions . DependencyInjection ;
11
13
12
14
namespace LinkDotNet . Blog . IntegrationTests . Web . Pages ;
@@ -45,6 +47,21 @@ public async Task ShouldHandleSpecialCharacters()
45
47
tags . Should ( ) . HaveCount ( 1 ) ;
46
48
}
47
49
50
+ [ Fact ]
51
+ public void ShouldSetTitleToTag ( )
52
+ {
53
+ using var ctx = new TestContext ( ) ;
54
+ ctx . Services . AddScoped < IRepository < BlogPost > > ( _ => Repository ) ;
55
+ ctx . Services . AddScoped ( _ => Mock . Of < IUserRecordService > ( ) ) ;
56
+ ctx . ComponentFactories . AddStub < PageTitle > ( ) ;
57
+
58
+ var cut = ctx . RenderComponent < SearchByTag > ( p => p . Add ( s => s . Tag , "Tag" ) ) ;
59
+
60
+ var pageTitleStub = cut . FindComponent < Stub < PageTitle > > ( ) ;
61
+ var pageTitle = ctx . Render ( pageTitleStub . Instance . Parameters . Get ( p => p . ChildContent ) ) ;
62
+ pageTitle . Markup . Should ( ) . Be ( "Search for tag: Tag" ) ;
63
+ }
64
+
48
65
private async Task AddBlogPostWithTagAsync ( string tag )
49
66
{
50
67
var blogPost = new BlogPostBuilder ( ) . WithTags ( tag ) . Build ( ) ;
You can’t perform that action at this time.
0 commit comments