use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testSaveWithOptions.
@Test
public void testSaveWithOptions() throws Exception {
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(1, 2, 10, 20, 60, 2);
this.questionTypeOptionsService.save(questionTypeOptionModel, questionTypeOptionsOptions);
verify(questionTypeOptionsOptions).saveWithRelations(questionTypeOptionModel);
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testDeleteWithOptions.
@Test
public void testDeleteWithOptions() throws Exception {
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(1, 1, 10, 20, 60, 1);
this.questionTypeOptionsService.delete(questionTypeOptionModel, questionTypeOptionsOptions);
verify(questionTypeOptionsOptions).deleteWithRelations(questionTypeOptionModel);
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testDeleteListWithOptions.
@Test
public void testDeleteListWithOptions() throws Exception {
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
this.questionTypeOptionsService.delete(questionTypeOptionModels, questionTypeOptionsOptions);
for (IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel : questionTypeOptionModels) {
verify(questionTypeOptionsOptions).deleteWithRelations(questionTypeOptionModel);
}
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testSaveList.
@Test
public void testSaveList() throws Exception {
final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = new ArrayList<>(2);
questionTypeOptionModels.add(Models.createQuestionTypeOptionModel(1, 1, 10, 20, 60, 1));
questionTypeOptionModels.add(Models.createQuestionTypeOptionModel(null, 1, 10, 20, 60, 1));
final Integer id = 10;
doAnswer(invocations -> {
final IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = (IssueStandardQuestionTypeOptionEntity) invocations.getArguments()[0];
questionTypeOptionEntity.setId(id);
return null;
}).when(this.questionTypeOptionsMapper).insert(Mockito.any(IssueStandardQuestionTypeOptionEntity.class));
this.questionTypeOptionsService.save(questionTypeOptionModels);
verify(this.questionTypeOptionsMapper, times(1)).update(this.mapQuestionTypeOptionEntity(questionTypeOptionModels.get(0)));
verify(this.questionTypeOptionsMapper, times(1)).insert(this.mapQuestionTypeOptionEntity(questionTypeOptionModels.get(1)));
Assert.assertEquals(id, questionTypeOptionModels.get(1).getId());
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testDeleteList.
@Test
public void testDeleteList() throws Exception {
final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
this.questionTypeOptionsService.delete(questionTypeOptionModels);
for (IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel : questionTypeOptionModels) {
verify(this.questionTypeOptionsMapper, times(1)).delete(this.mapQuestionTypeOptionEntity(questionTypeOptionModel));
}
}
Aggregations