use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testSaveUpdatesModel.
@Test
public void testSaveUpdatesModel() throws Exception {
final Integer id = 1;
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(id, 1, 10, 20, 300, 1);
Assert.assertNotEquals(questionTypeOptionModel, this.questionTypeOptionsService.find(id));
this.questionTypeOptionsService.save(questionTypeOptionModel);
Assert.assertEquals(questionTypeOptionModel, this.questionTypeOptionsService.find(id));
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testFindWithOptions.
@Test
public void testFindWithOptions() throws Exception {
final Integer id = 1;
final Integer issueStandardId = 1;
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(id, 1, 1, null, null, issueStandardId);
final IssueStandardModelInterface issueStandardModel = Models.createIssueStandardModel(issueStandardId, 300, 30, 1);
questionTypeOptionModel.setIssueStandard(issueStandardModel);
final IssueStandardQuestionTypeOptionModelInterface foundedQuestionTypeOptionModel = this.questionTypeOptionsService.find(id, new IssueStandardQuestionTypeOptionsOptions().withIssueStandard(new IssueStandardsOptions()));
Assert.assertEquals(questionTypeOptionModel, foundedQuestionTypeOptionModel);
Assert.assertEquals(issueStandardModel, foundedQuestionTypeOptionModel.getIssueStandard());
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testFindAbsentModel.
@Test
public void testFindAbsentModel() throws Exception {
final Integer id = 10;
final IssueStandardQuestionTypeOptionModelInterface foundedQuestionTypeOptionModel = this.questionTypeOptionsService.find(id);
Assert.assertNull(foundedQuestionTypeOptionModel);
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testFindPresentModel.
@Test
public void testFindPresentModel() throws Exception {
final Integer id = 1;
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(id, 1, 1, null, null, 1);
final IssueStandardQuestionTypeOptionModelInterface foundedQuestionTypeOptionModel = this.questionTypeOptionsService.find(id);
Assert.assertEquals(questionTypeOptionModel, foundedQuestionTypeOptionModel);
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testSaveCreatesEntity.
@Test
public void testSaveCreatesEntity() throws Exception {
final ArgumentCaptor<IssueStandardQuestionTypeOptionEntity> questionTypeOptionEntityCaptor = ArgumentCaptor.forClass(IssueStandardQuestionTypeOptionEntity.class);
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = this.questionTypeOptionsSupport.getModelAdditionalMock(0);
this.questionTypeOptionsService.save(questionTypeOptionModel);
verify(this.questionTypeOptionsMapper, times(1)).insert(questionTypeOptionEntityCaptor.capture());
this.questionTypeOptionsSupport.assertEquals(this.questionTypeOptionsSupport.getEntityAdditionalMock(0), questionTypeOptionEntityCaptor.getValue());
}
Aggregations