public ITopic_Alert_Options SetOptions(ITopic_Alert_Options options)
        {
            var a = AuthorService?.GetCurrentAuthor() ?? null;

            if (a == null)
            {
                return(options);
            }

            options.Search_Name    = $"{TextTranslator.Translate("Author.TopicAlert.Prefix")} {a?.First_Name} {a?.Last_Name}" ?? string.Empty;
            options.Related_Search = $"?{Constants.QueryString.AuthorFullName}={AuthorNamesField.ToAuthorName(a)}";

            return(options);
        }
Exemple #2
0
 public void ToAuthorName_HasFullName_ReturnsFullName()
 {
     staffItem.First_Name.Returns("John");
     staffItem.Last_Name.Returns("Johnson");
     Assert.AreEqual("John Johnson", AuthorNamesField.ToAuthorName(staffItem));
 }
Exemple #3
0
 public void ToAuthorName_OnlyLastName_ReturnsLastName()
 {
     staffItem.Last_Name.Returns("Johnson");
     Assert.AreEqual("Johnson", AuthorNamesField.ToAuthorName(staffItem));
 }
Exemple #4
0
 public void ToAuthorName_EmptyStaffItem_ReturnsEmptyString()
 {
     Assert.AreEqual(string.Empty, AuthorNamesField.ToAuthorName(staffItem));
 }
 private string GetAuthorNameParameter(IStaff_Item staffItem)
 {
     return($"{Constants.QueryString.AuthorFullName}={AuthorNamesField.ToAuthorName(staffItem)}");
 }
Exemple #6
0
        public void Author_Page()
        {
            if (DisplayTitle)
            {
                TitleText = GetTitleText(CurrentAuthorName);
            }

            Authors = new List <string> {
                RemoveSpecialCharactersFromGuid(CurrentAuthor._Id.ToString())
            };

            if (SeeAllLink != null)
            {
                SeeAllLink.Url = string.Format("/search#?{0}={1}", Constants.QueryString.AuthorFullName, AuthorNamesField.ToAuthorName(CurrentAuthor));
            }
        }