Exemplo n.º 1
0
        public void StoryPublished_Should_Increase_Score()
        {
            var story = new Mock <IStory>();

            story.ExpectGet(s => s.PostedBy).Returns(_user.Object);

            _user.Expect(u => u.IncreaseScoreBy(It.IsAny <decimal>(), UserAction.StoryPublished)).Verifiable();
            _userScoreService.StoryPublished(story.Object);
        }
Exemplo n.º 2
0
        public void StoryPublished_Should_Increase_Score()
        {
            List <PublishedStory> stories = new List <PublishedStory>();

            for (int i = 0; i < 5; i++)
            {
                var story = new Mock <IStory>();
                story.SetupGet(s => s.PostedBy).Returns(_user.Object);
                stories.Add(new PublishedStory(story.Object));
            }

            _user.Setup(u => u.IncreaseScoreBy(It.IsAny <decimal>(), UserAction.StoryPublished)).Verifiable();
            _userScoreService.StoryPublished(new StoryPublishEventArgs(stories, SystemTime.Now()));
        }