Example #1
0
        public void CountByPublishable_Should_Return_Correct_Result()
        {
            using (BeginTransaction())
            {
                GenerateStories(false, true, true);

                _database.SubmitChanges();
                var count = _storyRepository.CountByPublishable(SystemTime.Now().AddDays(-10), SystemTime.Now());

                Assert.True(count >= 10);
            }
        }
        public void CountByPublishable_Should_Return_Correct_Result()
        {
            var story1 = CreateStory();
            var story2 = CreateStory();
            var story3 = CreateStory();

            Stories.AddRange(new[] { story1 as Story, story2 as Story, story3 as Story });
            Stories.ForEach(s => s.ApprovedAt = SystemTime.Now().AddDays(-3));

            var result = _storyRepository.CountByPublishable(SystemTime.Now().AddDays(-7), SystemTime.Now().AddHours(-4));

            Assert.Equal(3, result);
        }