public void CountByStory_Should_Return_Correct_Count() { using (BeginTransaction()) { var view = CreateNewStoryView(); _database.InsertOnSubmit(view); _database.SubmitChanges(); var storyId = view.Story.Id; var count = _database.StoryViewDataSource.Count(v => v.Story.Id == storyId); Assert.Equal(count, _storyViewRepository.CountByStory(storyId)); } }
public void CountByStory_Should_Return_Correct_Count() { var storyId = Guid.NewGuid(); Views.Add(new StoryView { StoryId = storyId }); Views.Add(new StoryView { StoryId = storyId }); Views.Add(new StoryView { StoryId = storyId }); Assert.Equal(3, _storyViewRepository.CountByStory(storyId)); }