-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e9d31f
commit 57b4e4c
Showing
4 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@inject AppConfiguration appConfiguration | ||
|
||
<div class="py-4"> | ||
<footer class="text-center container"> | ||
<span class="py-2 mb-0 text-muted">© @DateTime.Now.Year @CopyrightName</span> | ||
</footer> | ||
</div> | ||
@code { | ||
private string CopyrightName => appConfiguration.IsAboutMeEnabled | ||
? appConfiguration.ProfileInformation.Name | ||
: string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Bunit; | ||
using FluentAssertions; | ||
using LinkDotNet.Blog.Domain; | ||
using LinkDotNet.Blog.Web; | ||
using LinkDotNet.Blog.Web.Shared; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Xunit; | ||
|
||
namespace LinkDotNet.Blog.UnitTests.Web.Shared; | ||
|
||
public class FooterTests : TestContext | ||
{ | ||
[Fact] | ||
public void ShouldSetCopyrightInformation() | ||
{ | ||
var appConfig = new AppConfiguration | ||
{ | ||
ProfileInformation = new ProfileInformation() | ||
{ | ||
Name = "Steven", | ||
}, | ||
}; | ||
Services.AddScoped(_ => appConfig); | ||
|
||
var cut = RenderComponent<Footer>(); | ||
|
||
cut.Find("span").TextContent.Should().Contain("Steven"); | ||
} | ||
|
||
[Fact] | ||
public void ShouldNotSetNameIfAboutMeIsNotEnabled() | ||
{ | ||
var appConfig = new AppConfiguration(); | ||
Services.AddScoped(_ => appConfig); | ||
|
||
var cut = RenderComponent<Footer>(); | ||
|
||
cut.Find("span").TextContent.Should().Contain("©"); | ||
} | ||
} |