File tree Expand file tree Collapse file tree 4 files changed +61
-6
lines changed
tests/LinkDotNet.Blog.UnitTests/Web/Shared Expand file tree Collapse file tree 4 files changed +61
-6
lines changed Original file line number Diff line number Diff line change 1+ @inject AppConfiguration appConfiguration
2+
3+ <div class =" py-4" >
4+ <footer class =" text-center container" >
5+ <span class =" py-2 mb-0 text-muted" >© @DateTime.Now.Year @CopyrightName </span >
6+ </footer >
7+ </div >
8+ @code {
9+ private string CopyrightName => appConfiguration .IsAboutMeEnabled
10+ ? appConfiguration .ProfileInformation .Name
11+ : string .Empty ;
12+ }
Original file line number Diff line number Diff line change 44<BlazoredToasts Position =" ToastPosition.BottomRight" />
55<div class =" position-relative" >
66 <NavMenu />
7-
8- <div class =" page" >
9- @Body
10- </div >
11- </div >
7+
8+ <main >
9+ <div class =" page" >
10+ @Body
11+ </div >
12+ </main >
13+ </div >
14+ <Footer ></Footer >
Original file line number Diff line number Diff line change 1010 --big-stone : # 193441 ;
1111
1212 --white : # ffffff ;
13- --wild-sand : # f4f4f4 ;
13+ --wild-sand : # f4f4f4 ;
1414
1515 /* Usages - this colors have to be defined in every theme */
1616 --active-link : var (--big-stone );
Original file line number Diff line number Diff line change 1+ using Bunit ;
2+ using FluentAssertions ;
3+ using LinkDotNet . Blog . Domain ;
4+ using LinkDotNet . Blog . Web ;
5+ using LinkDotNet . Blog . Web . Shared ;
6+ using Microsoft . Extensions . DependencyInjection ;
7+ using Xunit ;
8+
9+ namespace LinkDotNet . Blog . UnitTests . Web . Shared ;
10+
11+ public class FooterTests : TestContext
12+ {
13+ [ Fact ]
14+ public void ShouldSetCopyrightInformation ( )
15+ {
16+ var appConfig = new AppConfiguration
17+ {
18+ ProfileInformation = new ProfileInformation ( )
19+ {
20+ Name = "Steven" ,
21+ } ,
22+ } ;
23+ Services . AddScoped ( _ => appConfig ) ;
24+
25+ var cut = RenderComponent < Footer > ( ) ;
26+
27+ cut . Find ( "span" ) . TextContent . Should ( ) . Contain ( "Steven" ) ;
28+ }
29+
30+ [ Fact ]
31+ public void ShouldNotSetNameIfAboutMeIsNotEnabled ( )
32+ {
33+ var appConfig = new AppConfiguration ( ) ;
34+ Services . AddScoped ( _ => appConfig ) ;
35+
36+ var cut = RenderComponent < Footer > ( ) ;
37+
38+ cut . Find ( "span" ) . TextContent . Should ( ) . Contain ( "©" ) ;
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments