Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ public void ReturnTheProperTypeNameIfTheContentRepositoryIsNotProvided()
}


[Fact]
public void ReplaceTheDescriptionPlaceHolderWithThePageTitle()
{
String pageTemplateContent = "-----{Description}-----";
var pageTemplate = new Entities.Template() { Content = pageTemplateContent, TemplateType = Enumerations.TemplateType.ContactPage };
var templates = new List<Entities.Template>() { pageTemplate };

String sidebarContent = string.Empty.GetRandom();
String navContent = string.Empty.GetRandom();
String pageTitle = string.Empty.GetRandom();
String content = string.Empty.GetRandom();
String pathToRoot = string.Empty.GetRandom();

var container = (null as IServiceCollection).Create();
container.ReplaceDependency<IEnumerable<Entities.Template>>(templates);

var target = (null as ITemplateProcessor).Create(container);
var actual = target.ProcessNonContentItemTemplate(pageTemplate, sidebarContent, navContent, content, pageTitle, pathToRoot);

Assert.Contains(pageTitle, actual);
Assert.DoesNotContain("{Description}", actual);
}

[Fact]
public void ReplaceTheTitlePlaceHolderWithTheTitle()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public String ProcessNonContentItemTemplate(Entities.Template template, String s
{
return template.Content
.Replace("{Title}", pageTitle)
.Replace("{Description}", pageTitle)
.Replace("{ByLine}", String.Empty)
.ReplaceNonContentItemSpecificVariables(_serviceProvider, sidebarContent, navContent, content, pathToRoot);
}
Expand Down