Esempio n. 1
0
        public void CanGetHashtagById()
        {
            var manager  = HashTagManagerFactory.Create();
            var response = new GetHashTagResponse();

            response = manager.GetHashTag(1);

            Assert.IsNotNull(response.HashTag);
            Assert.IsTrue(response.Success);
            Assert.AreEqual(1, response.HashTag.HashTagId);
            Assert.AreEqual("#metapost", response.HashTag.HashTagName);
        }
        public GetHashTagResponse GetHashTag(int id)
        {
            var response = new GetHashTagResponse();

            response.HashTag = repo.GetHashTag(id);

            if (response.HashTag == null && !response.HashTag.HashTagName.Contains("#"))
            {
                response.Success = false;
                response.Message = "No hashtag associated with this id.";
            }
            else
            {
                response.Success = true;
            }


            return(response);
        }