예제 #1
0
        public MvcListLogbookPresenterTests()
        {
            A.CallTo(() => textFormatter.GetHtmlText(A <string> ._))
            .ReturnsLazily(call => $"{(string)call.Arguments[0]}_formatted");

            presenter = new MvcListLogbookPresenter(textFormatter);
        }
        private string GetFormattedTeaserText(ListAllLogbookEntriesOutputPort.LogbookItem logbookItem)
        {
            var teaserText = GetTeaserText(logbookItem);

            return(string.IsNullOrWhiteSpace(teaserText)
                ? teaserText
                : textFormatter.GetHtmlText(teaserText));
        }
예제 #3
0
        private void FormatNotification(StringBuilder htmlBuilder, Notification notification)
        {
            htmlBuilder.AppendLine($"<li class='{notification.Type.ToString()}'>");

            htmlBuilder.AppendLine("<div>");
            htmlBuilder.Append("<span class='timestamp'>");
            htmlBuilder.Append(notification.OccuredAt.ToLocalTime().ToStringSwissDateTime());
            htmlBuilder.Append("</span>");
            htmlBuilder.Append("<span class='message-type'>");
            htmlBuilder.Append(notificationTypeInfos.GetCaption(notification.Type));
            htmlBuilder.Append("</span>");
            htmlBuilder.AppendLine("</div>");

            htmlBuilder.AppendLine("<div class='message'>");
            htmlBuilder.Append(textFormatter.GetHtmlText(notification.Message));
            AddContextUrl(htmlBuilder, notification);
            htmlBuilder.AppendLine("</div>");

            htmlBuilder.AppendLine("</li>");
            htmlBuilder.AppendLine();
        }
 public HtmlString FormatText(string sourceText)
 {
     return(string.IsNullOrWhiteSpace(sourceText)
         ? new HtmlString("")
         : new HtmlString(textFormatter.GetHtmlText(sourceText)));
 }