Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public void ToAuthorName_HasFullName_ReturnsFullName()
 {
     staffItem.First_Name.Returns("John");
     staffItem.Last_Name.Returns("Johnson");
     Assert.AreEqual("John Johnson", AuthorNamesField.ToAuthorName(staffItem));
 }
Ejemplo n.º 3
0
 public void ToAuthorName_OnlyLastName_ReturnsLastName()
 {
     staffItem.Last_Name.Returns("Johnson");
     Assert.AreEqual("Johnson", AuthorNamesField.ToAuthorName(staffItem));
 }
Ejemplo n.º 4
0
 public void ToAuthorName_EmptyStaffItem_ReturnsEmptyString()
 {
     Assert.AreEqual(string.Empty, AuthorNamesField.ToAuthorName(staffItem));
 }
Ejemplo n.º 5
0
 private string GetAuthorNameParameter(IStaff_Item staffItem)
 {
     return($"{Constants.QueryString.AuthorFullName}={AuthorNamesField.ToAuthorName(staffItem)}");
 }
Ejemplo n.º 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));
            }
        }