use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class SubjectsSupport method getModelMock.
private SubjectModelInterface getModelMock(Integer id, String name, String description, Integer userId) {
final SubjectModelInterface subjectModel = Mockito.mock(SubjectModelInterface.class);
Mockito.when(subjectModel.getId()).thenReturn(id);
Mockito.when(subjectModel.getName()).thenReturn(name);
Mockito.when(subjectModel.getDescription()).thenReturn(description);
Mockito.when(subjectModel.getUser()).thenReturn(new UserModelEmpty(userId));
Mockito.when(subjectModel.getTopics()).thenReturn(new ModelsListEmpty());
Mockito.when(subjectModel.getIssueStandard()).thenReturn(new IssueStandardModelEmpty());
Mockito.when(subjectModel.getIssues()).thenReturn(new ModelsListEmpty());
return subjectModel;
}
use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class TopicsSupport method getModelMock.
private TopicModelInterface getModelMock(Integer id, String name, Integer subjectId) {
final TopicModelInterface topicModelMock = Mockito.mock(TopicModelInterface.class);
Mockito.when(topicModelMock.getId()).thenReturn(id);
Mockito.when(topicModelMock.getName()).thenReturn(name);
Mockito.when(topicModelMock.getSubject()).thenReturn(new SubjectModelEmpty(subjectId));
Mockito.when(topicModelMock.getQuestions()).thenReturn(new ModelsListEmpty());
return topicModelMock;
}
use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class IssueStandardEntityTest method testMap.
@Test
public void testMap() {
final Integer id = 5;
final Integer timeLimit = 3600;
final Integer questionsNumber = 30;
final Integer subjectId = 3;
final IssueStandardModelInterface issueStandardModel = Mockito.mock(IssueStandardModelInterface.class);
Mockito.when(issueStandardModel.getId()).thenReturn(id);
Mockito.when(issueStandardModel.getTimeLimit()).thenReturn(timeLimit);
Mockito.when(issueStandardModel.getQuestionsNumber()).thenReturn(questionsNumber);
Mockito.when(issueStandardModel.getTopicPriorities()).thenReturn(new ModelsListEmpty());
Mockito.when(issueStandardModel.getQuestionTypeOptions()).thenReturn(new ModelsListEmpty());
Mockito.when(issueStandardModel.getSubject()).thenReturn(new SubjectModelEmpty(subjectId));
final IssueStandardEntity issueStandardEntity = new IssueStandardEntity();
issueStandardEntity.map(issueStandardModel);
Assert.assertEquals(id, issueStandardEntity.getId());
Assert.assertEquals(timeLimit, issueStandardEntity.getTimeLimit());
Assert.assertEquals(questionsNumber, issueStandardEntity.getQuestionsNumber());
Assert.assertEquals(subjectId, issueStandardEntity.getSubjectId());
}
use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class IssuesServiceTest method testSaveModel.
@Test
public void testSaveModel() throws Exception {
final IssueModelInterface issueModel = new IssueModel();
issueModel.setName("test111");
issueModel.setQuizzes(new ModelsListEmpty());
issueModel.setSubject(new SubjectModelEmpty(1));
this.issuesService.save(issueModel);
final IssueModelInterface foundIssueModel = this.issuesService.find(issueModel.getId());
Assert.assertEquals(issueModel, foundIssueModel);
}
use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class SubjectsServiceTest method createSubjectModel.
private SubjectModelInterface createSubjectModel(Integer id, String name, Integer userId) {
final SubjectModelInterface subjectModel = new SubjectModel();
subjectModel.setId(id);
subjectModel.setName(name);
subjectModel.setTopics(new ModelsListEmpty());
subjectModel.setIssueStandard(new IssueStandardModelEmpty());
subjectModel.setUser(new UserModelEmpty(userId));
subjectModel.setIssues(new ModelsListEmpty());
return subjectModel;
}
Aggregations