Ejemplo n.º 1
0
        public ICommentSubscribtion CreateCommentSubscribtion(IStory forStory, IUser byUser)
        {
            Check.Argument.IsNotNull(forStory, "forStory");
            Check.Argument.IsNotNull(byUser, "byUser");

            var subscribtion = new CommentSubscribtion
            {
                Story = (Story)forStory,
                User  = (User)byUser
            };

            return(subscribtion);
        }
Ejemplo n.º 2
0
        public void UnsubscribeComment_Should_Decrease_Subscribers()
        {
            var user = new User {
                Id = Guid.NewGuid()
            };

            _story.SubscribeComment(user);

            var subscribtion = new CommentSubscribtion(_story, user);

            commentSubscribtionRepository.Setup(r => r.FindById(It.IsAny <Guid>(), It.IsAny <Guid>())).Returns(subscribtion);

            _story.UnsubscribeComment(user);

            Assert.Equal(0, _story.CommentSubscribersInternal.Count);
            Assert.Equal(0, _story.Subscribers.Count);
        }
 public CommentSubscribtionFixture()
 {
     _subscribtion = new CommentSubscribtion();
 }
Ejemplo n.º 4
0
 public CommentSubscribtionFixture()
 {
     _user         = new User();
     _story        = new Story();
     _subscribtion = new CommentSubscribtion(_story, _user);
 }