use of easytests.core.models.AnswerModel in project easy-tests by malinink.
the class AnswersServiceTest method testDeleteModelListWithOptions.
@Test
public void testDeleteModelListWithOptions() throws Exception {
final ArgumentCaptor<AnswerModel> answerModelCaptor = ArgumentCaptor.forClass(AnswerModel.class);
final AnswersOptionsInterface answersOptions = Mockito.mock(AnswersOptionsInterface.class);
final List<AnswerModelInterface> answersModels = getAnswersFixturesModels();
this.answersService.delete(answersModels, answersOptions);
verify(answersOptions, times(2)).deleteWithRelations(answerModelCaptor.capture());
final List<AnswerModel> capturedModels = answerModelCaptor.getAllValues();
Integer index = 0;
for (AnswerModelInterface answerModel : answersModels) {
this.answersSupport.assertEquals(answerModel, capturedModels.get(index));
index++;
}
verifyNoMoreInteractions(this.answersMapper);
}
use of easytests.core.models.AnswerModel in project easy-tests by malinink.
the class AnswersServiceTest method mapAnswerModel.
private AnswerModelInterface mapAnswerModel(AnswerEntity answerEntity) {
final AnswerModelInterface answerModel = new AnswerModel();
answerModel.map(answerEntity);
return answerModel;
}
use of easytests.core.models.AnswerModel in project easy-tests by malinink.
the class AnswerListDto method mapInto.
public void mapInto(QuestionModelInterface questionModel) {
final List<AnswerDto> answerDtoList = this.getAnswersList();
final List<AnswerModelInterface> answers = new ArrayList<>(this.getAnswersList().size());
for (AnswerDto answerDto : answerDtoList) {
final AnswerModelInterface answer = new AnswerModel();
answerDto.mapInto(answer);
answers.add(answer);
}
questionModel.setAnswers(answers);
}
use of easytests.core.models.AnswerModel in project easy-tests by malinink.
the class AnswersServiceTest method testDeleteModelWithOptions.
@Test
public void testDeleteModelWithOptions() throws Exception {
final ArgumentCaptor<AnswerModel> answerModelCaptor = ArgumentCaptor.forClass(AnswerModel.class);
final AnswersOptionsInterface answersOptions = Mockito.mock(AnswersOptionsInterface.class);
this.answersService.delete(this.answersSupport.getModelFixtureMock(0), answersOptions);
verify(answersOptions, times(1)).deleteWithRelations(answerModelCaptor.capture());
this.answersSupport.assertEquals(this.answersSupport.getModelFixtureMock(0), answerModelCaptor.getValue());
verifyNoMoreInteractions(this.answersMapper);
}
use of easytests.core.models.AnswerModel in project easy-tests by malinink.
the class AnswersService method map.
private AnswerModelInterface map(AnswerEntity answerEntity) {
final AnswerModelInterface answerModel = new AnswerModel();
answerModel.map(answerEntity);
return answerModel;
}
Aggregations