Search in sources :

Example 1 with IssueStandardEntity

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++;
    }
}
Also used : IssueStandardEntity(easytests.core.entities.IssueStandardEntity) Test(org.junit.Test)

Example 2 with IssueStandardEntity

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());
}
Also used : IssueStandardEntity(easytests.core.entities.IssueStandardEntity) Test(org.junit.Test)

Example 3 with IssueStandardEntity

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());
}
Also used : IssueStandardEntity(easytests.core.entities.IssueStandardEntity) Test(org.junit.Test)

Example 4 with IssueStandardEntity

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;
}
Also used : IssueStandardEntity(easytests.core.entities.IssueStandardEntity)

Example 5 with 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());
}
Also used : IssueStandardEntity(easytests.core.entities.IssueStandardEntity) Test(org.junit.Test)

Aggregations

IssueStandardEntity (easytests.core.entities.IssueStandardEntity)8 Test (org.junit.Test)7 ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)1 SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)1