コード例 #1
0
        public void CanGetHashTags()
        {
            var repo     = new HashTagRepo();
            var hashtags = repo.GetAllHashtags();

            Assert.AreEqual(4, hashtags.Count);
            Assert.AreEqual(1, hashtags[0].HashTagId);
            Assert.AreEqual("#metapost", hashtags[0].HashTagName);
        }
コード例 #2
0
        public void CanAddHashtag()
        {
            var repo    = new HashTagRepo();
            var hashtag = new HashTag();

            hashtag.HashTagId   = 1;
            hashtag.HashTagName = "#farts";
            hashtag.Approved    = false;

            repo.AddHashTag(hashtag);
            var hashtags = repo.GetAllHashtags();

            Assert.AreEqual(5, hashtags.Count);
            Assert.AreEqual(5, hashtags[4].HashTagId);
            Assert.AreEqual("#farts", hashtags[4].HashTagName);
            Assert.IsFalse(hashtags[4].Approved);
        }