use of easytests.core.models.AnswerModelInterface in project easy-tests by malinink.
the class AnswersServiceTest method testFindAllPresentList.
@Test
public void testFindAllPresentList() throws Exception {
final List<AnswerEntity> answersEntities = new ArrayList<>(2);
final AnswerEntity answerEntityFirst = this.createAnswerEntityMock(1, "Answer1", 1, 1, true);
final AnswerEntity answerEntitySecond = this.createAnswerEntityMock(2, "Answer2", 2, 2, false);
answersEntities.add(answerEntityFirst);
answersEntities.add(answerEntitySecond);
given(this.answersMapper.findAll()).willReturn(answersEntities);
final List<AnswerModelInterface> answersModels = this.answersService.findAll();
Assert.assertEquals(2, answersModels.size());
Assert.assertEquals(answersModels.get(0), this.mapAnswerModel(answerEntityFirst));
Assert.assertEquals(answersModels.get(1), this.mapAnswerModel(answerEntitySecond));
}
Aggregations