Пример #1
0
        public void BaseUrl()
        {
            var key  = Guid.NewGuid().ToString();
            var data = "/offer/" + key;

            Assert.AreEqual <string>(data, ItemCore.BaseUrl(key));
        }
Пример #2
0
        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)));
        }
Пример #3
0
        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");
            }
        }
Пример #4
0
        public void BaseUrlNull()
        {
            var data = "/offer/";

            Assert.AreEqual <string>(data, ItemCore.BaseUrl(null));
        }