use of org.olat.modules.qpool.model.ReviewDecision in project openolat by klemens.
the class QuestionPoolServiceImplTest method shouldSetNewStatusIfChanged.
@Test
public void shouldSetNewStatusIfChanged() {
Float rating = new Float(RATING_FIVE);
QuestionStatus status = QuestionStatus.finalVersion;
ReviewDecision decision = new ReviewDecision(true, status);
when(reviewServiceMock.decideStatus(item, rating)).thenReturn(decision);
sut.rateItemInReview(item, identityDummy, rating, null);
assertThat(item.getQuestionStatus()).isEqualTo(status);
}
use of org.olat.modules.qpool.model.ReviewDecision in project openolat by klemens.
the class LowerLimitProviderTest method shouldSetFinalIfEnoughRatings.
@Test
public void shouldSetFinalIfEnoughRatings() {
when(commentAndRatingServiceMock.countRatings(any(), any())).thenReturn(RATINGS_OK);
ReviewDecision decision = sut.decideStatus(item, RATING_OK);
assertThat(decision.isStatusChanged()).isTrue();
assertThat(decision.getStatus()).isEqualTo(QuestionStatus.finalVersion);
}
use of org.olat.modules.qpool.model.ReviewDecision in project OpenOLAT by OpenOLAT.
the class LowerLimitProviderTest method shouldSetRevisedIfRatingToLow.
@Test
public void shouldSetRevisedIfRatingToLow() {
ReviewDecision decision = sut.decideStatus(item, RATING_TO_LOW);
assertThat(decision.isStatusChanged()).isTrue();
assertThat(decision.getStatus()).isEqualTo(QuestionStatus.revised);
}
use of org.olat.modules.qpool.model.ReviewDecision in project OpenOLAT by OpenOLAT.
the class LowerLimitProviderTest method shouldSetFinalIfEnoughRatings.
@Test
public void shouldSetFinalIfEnoughRatings() {
when(commentAndRatingServiceMock.countRatings(any(), any())).thenReturn(RATINGS_OK);
ReviewDecision decision = sut.decideStatus(item, RATING_OK);
assertThat(decision.isStatusChanged()).isTrue();
assertThat(decision.getStatus()).isEqualTo(QuestionStatus.finalVersion);
}
use of org.olat.modules.qpool.model.ReviewDecision in project OpenOLAT by OpenOLAT.
the class LowerLimitProviderTest method shouldNotChangeStatusIfNotEnoughRatings.
@Test
public void shouldNotChangeStatusIfNotEnoughRatings() {
when(commentAndRatingServiceMock.countRatings(any(), any())).thenReturn(RATINGS_TOO_LITTLE);
ReviewDecision decision = sut.decideStatus(item, RATING_OK);
assertThat(decision.isStatusChanged()).isFalse();
assertThat(decision.getStatus()).isEqualTo(item.getQuestionStatus());
}
Aggregations