Пример #1
0
        public void CommentSubmitted_Should_SendMail()
        {
            var story = new Mock <IStory>();

            story.SetupGet(s => s.Subscribers).Returns(new List <IUser>());

            var comment = new Mock <IComment>();

            comment.SetupGet(c => c.ForStory).Returns(story.Object);

            _emailSender.Setup(es => es.SendComment(It.IsAny <string>(), It.IsAny <IComment>(), It.IsAny <IEnumerable <IUser> >())).Verifiable();

            _sendMail.CommentSubmitted(new CommentSubmitEventArgs(comment.Object, "http://dotnetshoutout.com"));

            _emailSender.Verify();
        }