use of easytests.core.models.empty.TesteeModelEmpty in project easy-tests by malinink.
the class QuizModelTest method testMap.
@Test
public void testMap() throws Exception {
final Integer quizId = 5;
final String quizInviteCode = "Test code";
final LocalDateTime quizStartedAt = LocalDateTime.of(2000, 1, 1, 1, 1, 1);
final LocalDateTime quizFinishedAt = LocalDateTime.of(2001, 1, 1, 1, 1, 1);
final Boolean quizCodeExpired = false;
final Integer quizIssueId = 3;
final QuizEntity quizEntity = Mockito.mock(QuizEntity.class);
Mockito.when(quizEntity.getId()).thenReturn(quizId);
Mockito.when(quizEntity.getInviteCode()).thenReturn(quizInviteCode);
Mockito.when(quizEntity.getStartedAt()).thenReturn(quizStartedAt);
Mockito.when(quizEntity.getFinishedAt()).thenReturn(quizFinishedAt);
Mockito.when(quizEntity.getCodeExpired()).thenReturn(quizCodeExpired);
Mockito.when(quizEntity.getIssueId()).thenReturn(quizIssueId);
final QuizModelInterface quizModel = new QuizModel();
quizModel.map(quizEntity);
Assert.assertEquals(quizId, quizModel.getId());
Assert.assertEquals(quizStartedAt, quizModel.getStartedAt());
Assert.assertEquals(quizFinishedAt, quizModel.getFinishedAt());
Assert.assertEquals(quizCodeExpired, quizModel.getCodeExpired());
Assert.assertEquals(new ModelsListEmpty(), quizModel.getPoints());
Assert.assertEquals(new IssueModelEmpty(quizIssueId), quizModel.getIssue());
Assert.assertEquals(new TesteeModelEmpty(), quizModel.getTestee());
}
use of easytests.core.models.empty.TesteeModelEmpty in project easy-tests by malinink.
the class QuizzesSupport method getModelMock.
private QuizModelInterface getModelMock(Integer id, Integer issueId, String inviteCode, Boolean codeExpired, LocalDateTime startedAt, LocalDateTime finishedAt) {
final QuizModelInterface quizModel = Mockito.mock(QuizModelInterface.class);
Mockito.when(quizModel.getId()).thenReturn(id);
Mockito.when(quizModel.getInviteCode()).thenReturn(inviteCode);
Mockito.when(quizModel.getCodeExpired()).thenReturn(codeExpired);
Mockito.when(quizModel.getStartedAt()).thenReturn(startedAt);
Mockito.when(quizModel.getFinishedAt()).thenReturn(finishedAt);
Mockito.when(quizModel.getIssue()).thenReturn(new IssueModelEmpty(issueId));
Mockito.when(quizModel.getPoints()).thenReturn(new ModelsListEmpty());
Mockito.when(quizModel.getTestee()).thenReturn(new TesteeModelEmpty());
return quizModel;
}
use of easytests.core.models.empty.TesteeModelEmpty in project easy-tests by malinink.
the class QuizModel method map.
public void map(QuizEntity quizEntity) {
this.setId(quizEntity.getId());
this.setCodeExpired(quizEntity.getCodeExpired());
this.setStartedAt(quizEntity.getStartedAt());
this.setFinishedAt(quizEntity.getFinishedAt());
this.setIssue(new IssueModelEmpty(quizEntity.getIssueId()));
this.setInviteCode(quizEntity.getInviteCode());
this.setPoints(new ModelsListEmpty());
this.setTestee(new TesteeModelEmpty());
}
Aggregations