use of easytests.core.entities.IssueStandardEntity in project easy-tests by malinink.
the class IssueStandardsMapperTest method testFindAll.
@Test
public void testFindAll() throws Exception {
final List<IssueStandardEntity> issueStandardsFoundedEntities = this.issueStandardsMapper.findAll();
Assert.assertEquals(2, issueStandardsFoundedEntities.size());
Integer index = 0;
for (IssueStandardEntity issueStandardEntity : issueStandardsFoundedEntities) {
final IssueStandardEntity issueStandartFixtureEntity = this.issueStandardSupport.getEntityFixtureMock(index);
this.issueStandardSupport.assertEquals(issueStandartFixtureEntity, issueStandardEntity);
index++;
}
}
use of easytests.core.entities.IssueStandardEntity in project easy-tests by malinink.
the class IssueStandardsMapperTest method testInsert.
@Test
public void testInsert() throws Exception {
final Integer id = this.issueStandardsMapper.findAll().size() + 1;
final Integer timeLimit = 3600;
final Integer questionsNumber = 20;
final Integer subjectId = 2;
IssueStandardEntity issueStandardEntity = Mockito.mock(IssueStandardEntity.class);
Mockito.when(issueStandardEntity.getTimeLimit()).thenReturn(timeLimit);
Mockito.when(issueStandardEntity.getQuestionsNumber()).thenReturn(questionsNumber);
Mockito.when(issueStandardEntity.getSubjectId()).thenReturn(subjectId);
this.issueStandardsMapper.insert(issueStandardEntity);
verify(issueStandardEntity, times(1)).setId(id);
issueStandardEntity = this.issueStandardsMapper.find(id);
Assert.assertEquals(id, issueStandardEntity.getId());
Assert.assertEquals(timeLimit, issueStandardEntity.getTimeLimit());
Assert.assertEquals(questionsNumber, issueStandardEntity.getQuestionsNumber());
Assert.assertEquals(subjectId, issueStandardEntity.getSubjectId());
}
use of easytests.core.entities.IssueStandardEntity in project easy-tests by malinink.
the class IssueStandardsMapperTest method testFindBySubjectId.
@Test
public void testFindBySubjectId() throws Exception {
final IssueStandardEntity issueStandardEntity = this.issueStandardsMapper.findBySubjectId(3);
Assert.assertEquals((Integer) 2, issueStandardEntity.getId());
Assert.assertEquals(null, issueStandardEntity.getTimeLimit());
Assert.assertEquals((Integer) 15, issueStandardEntity.getQuestionsNumber());
Assert.assertEquals((Integer) 3, issueStandardEntity.getSubjectId());
}
use of easytests.core.entities.IssueStandardEntity in project easy-tests by malinink.
the class IssueStandardSupport method getEntityMock.
private IssueStandardEntity getEntityMock(Integer id, Integer timeLimit, Integer questionsNumber, Integer subjectId) {
final IssueStandardEntity issueStandardEntity = Mockito.mock(IssueStandardEntity.class);
Mockito.when(issueStandardEntity.getId()).thenReturn(id);
Mockito.when(issueStandardEntity.getTimeLimit()).thenReturn(timeLimit);
Mockito.when(issueStandardEntity.getQuestionsNumber()).thenReturn(questionsNumber);
Mockito.when(issueStandardEntity.getSubjectId()).thenReturn(subjectId);
return issueStandardEntity;
}
use of easytests.core.entities.IssueStandardEntity in project easy-tests by malinink.
the class IssueStandardsMapperTest method testFind.
@Test
public void testFind() throws Exception {
final IssueStandardEntity issueStandardEntity = this.issueStandardsMapper.find(1);
Assert.assertEquals((Integer) 1, issueStandardEntity.getId());
Assert.assertEquals((Integer) 300, issueStandardEntity.getTimeLimit());
Assert.assertEquals((Integer) 30, issueStandardEntity.getQuestionsNumber());
Assert.assertEquals((Integer) 1, issueStandardEntity.getSubjectId());
}
Aggregations