Search in sources :

Example 11 with ModelsListEmpty

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()));
}
Also used : SubjectModelEmpty(easytests.core.models.empty.SubjectModelEmpty) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty)

Example 12 with ModelsListEmpty

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());
}
Also used : ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) UserModelEmpty(easytests.core.models.empty.UserModelEmpty) IssueStandardModelEmpty(easytests.core.models.empty.IssueStandardModelEmpty)

Example 13 with 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());
}
Also used : SubjectModelEmpty(easytests.core.models.empty.SubjectModelEmpty) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty)

Example 14 with 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());
}
Also used : LocalDateTime(java.time.LocalDateTime) QuizEntity(easytests.core.entities.QuizEntity) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) TesteeModelEmpty(easytests.core.models.empty.TesteeModelEmpty) IssueModelEmpty(easytests.core.models.empty.IssueModelEmpty) Test(org.junit.Test)

Example 15 with ModelsListEmpty

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());
}
Also used : SubjectEntity(easytests.core.entities.SubjectEntity) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) UserModelEmpty(easytests.core.models.empty.UserModelEmpty) IssueStandardModelEmpty(easytests.core.models.empty.IssueStandardModelEmpty) Test(org.junit.Test)

Aggregations

ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)36 Test (org.junit.Test)13 SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)11 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)8 IssueStandardModelEmpty (easytests.core.models.empty.IssueStandardModelEmpty)7 UserModelEmpty (easytests.core.models.empty.UserModelEmpty)7 QuestionTypeModelEmpty (easytests.core.models.empty.QuestionTypeModelEmpty)5 TopicModelEmpty (easytests.core.models.empty.TopicModelEmpty)5 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)4 SubjectModelInterface (easytests.core.models.SubjectModelInterface)4 IssueModelEmpty (easytests.core.models.empty.IssueModelEmpty)3 QuestionModelEmpty (easytests.core.models.empty.QuestionModelEmpty)3 QuizModelEmpty (easytests.core.models.empty.QuizModelEmpty)3 TesteeModelEmpty (easytests.core.models.empty.TesteeModelEmpty)3 IssueStandardQuestionTypeOptionModelInterface (easytests.core.models.IssueStandardQuestionTypeOptionModelInterface)2 IssueStandardTopicPriorityModelInterface (easytests.core.models.IssueStandardTopicPriorityModelInterface)2 IssueStandardQuestionTypeOptionsServiceInterface (easytests.core.services.IssueStandardQuestionTypeOptionsServiceInterface)2 IssueStandardTopicPrioritiesServiceInterface (easytests.core.services.IssueStandardTopicPrioritiesServiceInterface)2 SubjectsServiceInterface (easytests.core.services.SubjectsServiceInterface)2 ArrayList (java.util.ArrayList)2