public void BaseUrl() { var key = Guid.NewGuid().ToString(); var data = "/offer/" + key; Assert.AreEqual <string>(data, ItemCore.BaseUrl(key)); }
public ActionResult SaveTag(Guid itemIdentifier, string tags) { if (Guid.Empty == itemIdentifier) { throw new ArgumentException("item idenfitier"); } if (string.IsNullOrWhiteSpace(tags)) { throw new ArgumentException(); } var userId = User.Identifier(); var save = new SocialTags() { ReferenceIdentifier = itemIdentifier, Tags = tags, UserIdentifier = userId, }; this.socialCore.SaveTags(save); var item = this.itemCore.GetItem(itemIdentifier, null, null, true); return(this.Redirect(ItemCore.BaseUrl(item.Key))); }
public static string RelativeLink(this SearchResult result) { switch (result.Type) { case Reference.ItemRequest: return(ItemRequestCore.BaseUrl(result.Key)); case Reference.Item: return(ItemCore.BaseUrl(result.Key)); case Reference.User: return(ProfileCore.BaseUrl(result.Key)); case Reference.Company: return(CompanyCore.BaseUrl(result.Key)); default: throw new InvalidOperationException("unkown type"); } }
public void BaseUrlNull() { var data = "/offer/"; Assert.AreEqual <string>(data, ItemCore.BaseUrl(null)); }