Example #1
0
 public void CountByStory_Should_Return_Correct_Count()
 {
     using (BeginTransaction())
     {
         var vote = CreateNewStoryVote();
         _database.InsertOnSubmit(vote);
         _database.SubmitChanges();
         var story = vote.Story;
         var count = story.StoryVotesInternal.CreateSourceQuery().Count();
         Assert.Equal(count, _voteRepository.CountByStory(story.Id));
     }
 }
Example #2
0
        public void CountByStory_Should_Return_Correct_Count()
        {
            var storyId = Guid.NewGuid();

            Votes.Add(new StoryVote {
                StoryId = storyId
            });
            Votes.Add(new StoryVote {
                StoryId = storyId
            });
            Votes.Add(new StoryVote {
                StoryId = storyId
            });

            Assert.Equal(3, _voteRepository.CountByStory(storyId));
        }