public void SearchUrl() { var term = Guid.NewGuid().ToString(); var data = "/search/member?s=" + term + "&c=organic"; Assert.AreEqual <string>(data, ProfileCore.SearchUrl(term)); }
/// <summary> /// Profile Directory /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Unique(Guid?id, string key = null) { if (!id.HasValue && string.IsNullOrWhiteSpace(key)) { return(RedirectToAction("Index")); } var callerId = User.IdentifierSafe(); var profile = new ProfileMaster() { Display = profileCore.SearchSingle(id, key, callerId), }; if (null != profile.Display) { profile.Display.Badges = badgeCore.Search(profile.Display.Identifier); profile.Display.Activities = activityCore.UserSearch(profile.Display.Identifier); profile.Display.Items = itemCore.Search(profile.Display.Identifier, null, null, short.MaxValue, callerId); profile.ItemRequests = itemRequestCore.Search(profile.Display.Identifier, callerId); profile.Lent = from s in this.borrowCore.Lent(profile.Display.Identifier) where s.Status == BorrowStatus.Returned select s; profile.Borrowed = from s in this.borrowCore.Borrowed(profile.Display.Identifier) where s.Status == BorrowStatus.Returned select s; return(View(profile)); } else if (!string.IsNullOrWhiteSpace(key)) { return(Redirect(ProfileCore.SearchUrl(key, "unknown_key"))); } else { return(RedirectToAction("index")); } }
public static string RelativeSearch(this IReferenceType reference, string query) { switch (reference.Type) { case Reference.ItemRequest: return(ItemRequestCore.SearchUrl(query)); case Reference.Item: return(ItemCore.SearchUrl(query)); case Reference.User: return(ProfileCore.SearchUrl(query)); case Reference.Company: return(CompanyCore.SearchUrl(query)); default: return(null); } }
public void SearchUrlNull() { var data = "/search/member?s=&c=organic"; Assert.AreEqual <string>(data, ProfileCore.SearchUrl(null)); }