Blog.Logic.Core.Tests.TagsLogicTest.ShouldGetTagsByName C# (CSharp) Method

ShouldGetTagsByName() private method

private ShouldGetTagsByName ( ) : void
return void
        public void ShouldGetTagsByName()
        {
            const string tagName = "ipsum";
            var tags = _tags.Where(a => a.TagName.Contains(tagName)).ToList();

            _tagRepository = new Mock<ITagRepository>();
            _tagRepository.Setup(a => a.Find(It.IsAny<Expression<Func<Tag, bool>>>(), true))
                .Returns(tags);

            _postRepository = new Mock<IPostRepository>();

            _tagsLogic = new TagsLogic(_tagRepository.Object, _postRepository.Object);

            var result = _tagsLogic.GetTagsByName(tagName);

            Assert.AreEqual(2, result.Count);
        }