Exemplo n.º 1
0
        //[ExpectedException]
        public void UpdateTagNames_With_Empty_Tags()
        {
            var          tagRepository   = Substitute.For <ITopicTagRepository>();
            var          topicRepository = Substitute.For <ITopicRepository>();
            var          topicTagService = new TopicTagService(tagRepository, topicRepository);
            const string oldName         = "";
            const string newName         = "";

            tagRepository.GetTagName(oldName).Returns(x => null);

            topicTagService.UpdateTagNames(newName, oldName);

            tagRepository.DidNotReceiveWithAnyArgs().Update(Arg.Is <TopicTag>(x => x.Tag == null));
        }
Exemplo n.º 2
0
        public void UpdateTagNames_With_Non_Existing_Tag()
        {
            var tagRepository   = Substitute.For <ITopicTagRepository>();
            var topicRepository = Substitute.For <ITopicRepository>();
            var topicTagService = new TopicTagService(tagRepository, topicRepository);
            var oldName         = "bilbo";
            var newName         = "baggins";

            tagRepository.GetTagName(oldName).Returns(x => null);

            topicTagService.UpdateTagNames(newName, oldName);

            tagRepository.DidNotReceiveWithAnyArgs().Update(Arg.Is <TopicTag>(x => x.Tag == null));
        }