use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsMapperTest method testUpdate.
@Test
public void testUpdate() throws Exception {
final Integer id = 4;
final Integer questionTypeId = 2;
final Integer minQuestions = 10;
final Integer maxQuestions = 20;
final Integer timeLimit = 100;
final Integer issueStandardId = 2;
IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = this.questionTypeOptionMapper.find(id);
Assert.assertNotNull(questionTypeOptionEntity);
Assert.assertEquals(id, questionTypeOptionEntity.getId());
Assert.assertNotEquals(questionTypeId, questionTypeOptionEntity.getQuestionTypeId());
Assert.assertNotEquals(minQuestions, questionTypeOptionEntity.getMinQuestions());
Assert.assertNotEquals(maxQuestions, questionTypeOptionEntity.getMaxQuestions());
Assert.assertNotEquals(timeLimit, questionTypeOptionEntity.getTimeLimit());
Assert.assertEquals(issueStandardId, questionTypeOptionEntity.getIssueStandardId());
questionTypeOptionEntity = Mockito.mock(IssueStandardQuestionTypeOptionEntity.class);
Mockito.when(questionTypeOptionEntity.getId()).thenReturn(id);
Mockito.when(questionTypeOptionEntity.getQuestionTypeId()).thenReturn(questionTypeId);
Mockito.when(questionTypeOptionEntity.getMinQuestions()).thenReturn(minQuestions);
Mockito.when(questionTypeOptionEntity.getMaxQuestions()).thenReturn(maxQuestions);
Mockito.when(questionTypeOptionEntity.getTimeLimit()).thenReturn(timeLimit);
Mockito.when(questionTypeOptionEntity.getIssueStandardId()).thenReturn(issueStandardId);
this.questionTypeOptionMapper.update(questionTypeOptionEntity);
questionTypeOptionEntity = this.questionTypeOptionMapper.find(id);
Assert.assertEquals(id, questionTypeOptionEntity.getId());
Assert.assertEquals(questionTypeId, questionTypeOptionEntity.getQuestionTypeId());
Assert.assertEquals(minQuestions, questionTypeOptionEntity.getMinQuestions());
Assert.assertEquals(maxQuestions, questionTypeOptionEntity.getMaxQuestions());
Assert.assertEquals(timeLimit, questionTypeOptionEntity.getTimeLimit());
Assert.assertEquals(issueStandardId, questionTypeOptionEntity.getIssueStandardId());
}
use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsMapperTest method testFindByIssueStandard.
@Test
public void testFindByIssueStandard() throws Exception {
Integer issueStandardId = 1;
final List<IssueStandardQuestionTypeOptionEntity> questionTypeOptionEntities = this.questionTypeOptionMapper.findByIssueStandardId(issueStandardId);
Assert.assertEquals(3, questionTypeOptionEntities.size());
IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = questionTypeOptionEntities.get(2);
Assert.assertEquals((Integer) 3, questionTypeOptionEntity.getId());
Assert.assertEquals((Integer) 3, questionTypeOptionEntity.getQuestionTypeId());
Assert.assertEquals((Integer) 5, questionTypeOptionEntity.getMinQuestions());
Assert.assertEquals((Integer) 10, questionTypeOptionEntity.getMaxQuestions());
Assert.assertEquals(null, questionTypeOptionEntity.getTimeLimit());
Assert.assertEquals((Integer) 1, questionTypeOptionEntity.getIssueStandardId());
}
use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsMapperTest method testFind.
@Test
public void testFind() throws Exception {
final IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = this.questionTypeOptionMapper.find(1);
Assert.assertEquals((Integer) 1, questionTypeOptionEntity.getId());
Assert.assertEquals((Integer) 1, questionTypeOptionEntity.getQuestionTypeId());
Assert.assertEquals((Integer) 1, questionTypeOptionEntity.getMinQuestions());
Assert.assertEquals(null, questionTypeOptionEntity.getMaxQuestions());
Assert.assertEquals(null, questionTypeOptionEntity.getTimeLimit());
Assert.assertEquals((Integer) 1, questionTypeOptionEntity.getIssueStandardId());
}
use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method mapQuestionTypeOptionEntity.
private IssueStandardQuestionTypeOptionEntity mapQuestionTypeOptionEntity(IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel) {
IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = new IssueStandardQuestionTypeOptionEntity();
questionTypeOptionEntity.map(questionTypeOptionModel);
return questionTypeOptionEntity;
}
use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testFindAllWithOptions.
@Test
public void testFindAllWithOptions() throws Exception {
final List<IssueStandardQuestionTypeOptionEntity> questionTypeOptionEntities = this.getQuestionTypeOptionEntities();
final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
given(this.questionTypeOptionsMapper.findAll()).willReturn(questionTypeOptionEntities);
given(questionTypeOptionsOptions.withRelations(Mockito.anyList())).willReturn(questionTypeOptionModels);
final List<IssueStandardQuestionTypeOptionModelInterface> foundedQuestionTypeOptionModels = this.questionTypeOptionsService.findAll(questionTypeOptionsOptions);
verify(questionTypeOptionsOptions).withRelations(questionTypeOptionModels);
Assert.assertNotNull(foundedQuestionTypeOptionModels);
Assert.assertEquals(questionTypeOptionModels, foundedQuestionTypeOptionModels);
}
Aggregations