public ReviewItemListBuilder WithExistingItems(int count)
        {
            var existingItems = new ReviewItemBuilder().Due().Build(count);

            _items.AddRange(existingItems);
            return(this);
        }
        public ReviewItemListBuilder WithDueItems(int count)
        {
            var itemsToAdd = new ReviewItemBuilder().Due().Build(count);
            _items.AddRange(itemsToAdd);

            return this;
        }
        public ReviewItemListBuilder WithNewItems(int count)
        {
            var newItems = new ReviewItemBuilder().NeverReviewed().Build(count);

            _items.AddRange(newItems);
            return(this);
        }
        public ReviewItemListBuilder WithFutureItems(int count)
        {
            var futureItems = new ReviewItemBuilder().Future().Build(count);
            _items.AddRange(futureItems);

            return this;
        }
        public ReviewItemListBuilder WithDueItems(int count)
        {
            var itemsToAdd = new ReviewItemBuilder().Due().Build(count);

            _items.AddRange(itemsToAdd);

            return(this);
        }
        public ReviewItemListBuilder WithFutureItems(int count)
        {
            var futureItems = new ReviewItemBuilder().Future().Build(count);

            _items.AddRange(futureItems);

            return(this);
        }
        public void reviewing_updates_ReviewOutcome(ReviewOutcome outcome)
        {
            var item = new ReviewItemBuilder().Due().Build();

            var session = new StudySession<ReviewItem>(new[] { item }) { Clock = _clock };
            var review = session.Review(item, outcome);

            Assert.That(review.ReviewOutcome, Is.EqualTo(outcome));
        }
        public void incorrect_review_resets_PreviousReviewDate()
        {
            var correctReviewStreak = 3;
            var item = new ReviewItemBuilder().Due().WithCorrectReviewStreak(correctReviewStreak).Build();

            var session = new StudySession <ReviewItem>(new[] { item });
            var review  = session.Review(item, ReviewOutcome.Incorrect);

            Assert.That(review.PreviousCorrectReview, Is.EqualTo(DateTime.MinValue));
        }
        public void correct_review_outcome_increments_CorrectReviewStreak(ReviewOutcome outcome)
        {
            var correctReviewStreak = 3;
            var item = new ReviewItemBuilder().Due().WithCorrectReviewStreak(correctReviewStreak).Build();

            var session = new StudySession <ReviewItem>(new[] { item });
            var review  = session.Review(item, outcome);

            Assert.That(review.CorrectReviewStreak, Is.EqualTo(correctReviewStreak + 1));
        }
        public void incorrect_review_resets_PreviousReviewDate()
        {
            var correctReviewStreak = 3;
            var item = new ReviewItemBuilder().Due().WithCorrectReviewStreak(correctReviewStreak).Build();

            var session = new StudySession<ReviewItem>(new[] { item });
            var review = session.Review(item, ReviewOutcome.Incorrect);

            Assert.That(review.PreviousCorrectReview, Is.EqualTo(DateTime.MinValue));
        }
        public void correct_review_outcome_increments_CorrectReviewStreak(ReviewOutcome outcome)
        {
            var correctReviewStreak = 3;
            var item = new ReviewItemBuilder().Due().WithCorrectReviewStreak(correctReviewStreak).Build();

            var session = new StudySession<ReviewItem>(new[] { item });
            var review = session.Review(item, outcome);

            Assert.That(review.CorrectReviewStreak, Is.EqualTo(correctReviewStreak + 1));
        }
        public void correct_review_outcome_sets_PreviousCorrectReview(ReviewOutcome outcome)
        {
            var correctReviewStreak = 3;
            var item       = new ReviewItemBuilder().Due().WithCorrectReviewStreak(correctReviewStreak).Build();
            var reviewDate = item.ReviewDate;

            var session = new StudySession <ReviewItem>(new[] { item });
            var review  = session.Review(item, outcome);

            Assert.That(review.PreviousCorrectReview, Is.EqualTo(reviewDate));
        }
        public void correct_review_outcome_sets_PreviousCorrectReview(ReviewOutcome outcome)
        {
            var correctReviewStreak = 3;
            var item = new ReviewItemBuilder().Due().WithCorrectReviewStreak(correctReviewStreak).Build();
            var reviewDate = item.ReviewDate;

            var session = new StudySession<ReviewItem>(new[] { item });
            var review = session.Review(item, outcome);

            Assert.That(review.PreviousCorrectReview, Is.EqualTo(reviewDate));
        }
        public void reviewing_updates_ReviewOutcome(ReviewOutcome outcome)
        {
            var item = new ReviewItemBuilder().Due().Build();

            var session = new StudySession <ReviewItem>(new[] { item })
            {
                Clock = _clock
            };
            var review = session.Review(item, outcome);

            Assert.That(review.ReviewOutcome, Is.EqualTo(outcome));
        }
        public void reviewing_updates_DifficultyRating_based_on_review_strategy(ReviewOutcome outcome)
        {
            var item = new ReviewItemBuilder().Due().WithDifficultyRating(DifficultyRating.MostDifficult).Build();

            var session = new StudySession <ReviewItem>(new[] { item })
            {
                ReviewStrategy = new SimpleReviewStrategy()
            };
            var review = session.Review(item, outcome);

            Assert.That(review.DifficultyRating, Is.EqualTo(DifficultyRating.Easiest));
        }
        public void reviewing_updates_DifficultyRating_based_on_review_strategy(ReviewOutcome outcome)
        {
            var item = new ReviewItemBuilder().Due().WithDifficultyRating(DifficultyRating.MostDifficult).Build();

            var session = new StudySession<ReviewItem>(new[] { item }) { ReviewStrategy = new SimpleReviewStrategy() };
            var review = session.Review(item, outcome);

            Assert.That(review.DifficultyRating, Is.EqualTo(DifficultyRating.Easiest));
        }
 public ReviewItemListBuilder WithNewItems(int count)
 {
     var newItems = new ReviewItemBuilder().NeverReviewed().Build(count);
     _items.AddRange(newItems);
     return this;
 }
 public ReviewItemListBuilder WithExistingItems(int count)
 {
     var existingItems = new ReviewItemBuilder().Due().Build(count);
     _items.AddRange(existingItems);
     return this;
 }