public void CountByStory_Should_Return_Correct_Count() { using (BeginTransaction()) { var story = GenerateStoryGraph(); var comment = CreateNewComment(story, story.User, "some content"); _database.InsertOnSubmit(story); _database.InsertOnSubmit(comment); _database.SubmitChanges(); var count = story.StoryCommentsInternal.CreateSourceQuery().Count(); Assert.Equal(count, _commentRepository.CountByStory(story.Id)); } }
public void CountByStory_Should_Return_Correct_Count() { var storyId = Guid.NewGuid(); Comments.Add(new StoryComment { StoryId = storyId }); Comments.Add(new StoryComment { StoryId = storyId }); Comments.Add(new StoryComment { StoryId = storyId }); Assert.Equal(3, _commentRepository.CountByStory(storyId)); }