Skip to content

Commit 3699d23

Browse files
committed
Added config for brand url
1 parent 94d5cac commit 3699d23

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/LinkDotNet.Blog.Web/AppConfiguration.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ public record AppConfiguration
77
{
88
public string BlogName { get; init; }
99

10+
11+
public string BlogBrandUrl { get; init; }
12+
1013
public string LinkedinAccountUrl { get; init; }
1114

1215
public bool HasLinkedinAccount => !string.IsNullOrEmpty(LinkedinAccountUrl);

src/LinkDotNet.Blog.Web/AppConfigurationFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public static AppConfiguration Create(IConfiguration config)
1414
var configuration = new AppConfiguration
1515
{
1616
BlogName = config["BlogName"],
17+
BlogBrandUrl = config["BlogBrandUrl"],
1718
GithubAccountUrl = config["GithubAccountUrl"],
1819
LinkedinAccountUrl = config["LinkedInAccountUrl"],
1920
Introduction = config.GetSection("Introduction").Get<Introduction>(),

tests/LinkDotNet.Blog.UnitTests/Web/AppConfigurationFactoryTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public void ShouldMapFromAppConfiguration()
1414
var inMemorySettings = new Dictionary<string, string>
1515
{
1616
{ "BlogName", "UnitTest" },
17+
{ "BlogBrandUrl", "http://localhost" },
1718
{ "GithubAccountUrl", "github" },
1819
{ "LinkedInAccountUrl", "linkedIn" },
1920
{ "ConnectionString", "cs" },
@@ -38,6 +39,7 @@ public void ShouldMapFromAppConfiguration()
3839
var appConfiguration = AppConfigurationFactory.Create(configuration);
3940

4041
appConfiguration.BlogName.Should().Be("UnitTest");
42+
appConfiguration.BlogBrandUrl.Should().Be("http://localhost");
4143
appConfiguration.GithubAccountUrl.Should().Be("github");
4244
appConfiguration.HasGithubAccount.Should().BeTrue();
4345
appConfiguration.LinkedinAccountUrl.Should().Be("linkedIn");

0 commit comments

Comments
 (0)