use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class IssueStandardModel method map.
public void map(IssueStandardEntity issueStandardEntity) {
this.setId(issueStandardEntity.getId());
this.setTimeLimit(issueStandardEntity.getTimeLimit());
this.setQuestionsNumber(issueStandardEntity.getQuestionsNumber());
this.setTopicPriorities(new ModelsListEmpty());
this.setQuestionTypeOptions(new ModelsListEmpty());
this.setSubject(new SubjectModelEmpty(issueStandardEntity.getSubjectId()));
}
use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class SubjectModel method map.
public void map(SubjectEntity subjectEntity) {
this.setId(subjectEntity.getId());
this.setName(subjectEntity.getName());
this.setDescription(subjectEntity.getDescription());
this.setTopics(new ModelsListEmpty());
this.setUser(new UserModelEmpty(subjectEntity.getUserId()));
this.setIssueStandard(new IssueStandardModelEmpty());
this.setIssues(new ModelsListEmpty());
}
use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class TopicModel method map.
public void map(TopicEntity topicEntity) {
this.setId(topicEntity.getId());
this.setName(topicEntity.getName());
this.setSubject(new SubjectModelEmpty(topicEntity.getSubjectId()));
this.setQuestions(new ModelsListEmpty());
}
use of easytests.core.models.empty.ModelsListEmpty 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.ModelsListEmpty in project easy-tests by malinink.
the class SubjectModelTest method testMap.
@Test
public void testMap() throws Exception {
final Integer subjectId = 5;
final String subjectName = "Test subject";
final String subjectDescription = "Test subject description";
final Integer subjectUserId = 3;
final SubjectEntity subjectEntity = Mockito.mock(SubjectEntity.class);
Mockito.when(subjectEntity.getId()).thenReturn(subjectId);
Mockito.when(subjectEntity.getName()).thenReturn(subjectName);
Mockito.when(subjectEntity.getDescription()).thenReturn(subjectDescription);
Mockito.when(subjectEntity.getUserId()).thenReturn(subjectUserId);
final SubjectModelInterface subjectModel = new SubjectModel();
subjectModel.map(subjectEntity);
Assert.assertEquals(subjectId, subjectModel.getId());
Assert.assertEquals(subjectName, subjectModel.getName());
Assert.assertEquals(subjectDescription, subjectModel.getDescription());
Assert.assertEquals(new ModelsListEmpty(), subjectModel.getTopics());
Assert.assertEquals(new UserModelEmpty(subjectUserId), subjectModel.getUser());
Assert.assertEquals(new IssueStandardModelEmpty(), subjectModel.getIssueStandard());
Assert.assertEquals(new ModelsListEmpty(), subjectModel.getIssues());
}
Aggregations