use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class UserModelTest method testMap.
@Test
public void testMap() throws Exception {
final Integer userId = 3;
final String firstName = "FirstName";
final String lastName = "LastName";
final String surname = "Surname";
final String email = "email";
final String password = "password";
final Boolean isAdmin = false;
final Integer state = 2;
final UserEntity userEntity = Entities.createUserEntityMock(userId, firstName, lastName, surname, email, password, isAdmin, state);
final UserModel userModel = new UserModel();
userModel.map(userEntity);
Assert.assertEquals(userId, userModel.getId());
Assert.assertEquals(firstName, userModel.getFirstName());
Assert.assertEquals(lastName, userModel.getLastName());
Assert.assertEquals(surname, userModel.getSurname());
Assert.assertEquals(email, userModel.getEmail());
Assert.assertEquals(password, userModel.getPassword());
Assert.assertEquals(isAdmin, userModel.getIsAdmin());
Assert.assertEquals(state, userModel.getState());
Assert.assertEquals(new ModelsListEmpty(), userModel.getSubjects());
}
use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class SubjectEntityTest method testMap.
@Test
public void testMap() throws Exception {
final Integer subjectId = 5;
final String subjectName = "Test subject";
final Integer subjectUserId = 1;
final SubjectModelInterface subjectModel = Mockito.mock(SubjectModelInterface.class);
Mockito.when(subjectModel.getId()).thenReturn(subjectId);
Mockito.when(subjectModel.getName()).thenReturn(subjectName);
Mockito.when(subjectModel.getTopics()).thenReturn(new ModelsListEmpty());
Mockito.when(subjectModel.getUser()).thenReturn(new UserModelEmpty(subjectUserId));
Mockito.when(subjectModel.getIssueStandard()).thenReturn(new IssueStandardModelEmpty());
Mockito.when(subjectModel.getIssues()).thenReturn(new ModelsListEmpty());
final SubjectEntity subjectEntity = new SubjectEntity();
subjectEntity.map(subjectModel);
Assert.assertEquals(subjectId, subjectEntity.getId());
Assert.assertEquals(subjectName, subjectEntity.getName());
Assert.assertEquals(subjectUserId, subjectEntity.getUserId());
}
use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class IssueStandardSupport method getModelMock.
private IssueStandardModelInterface getModelMock(Integer id, Integer timeLimit, Integer questionsNumber, Integer subjectId) {
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));
return issueStandardModel;
}
use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.
the class QuestionsSupport method getModelMock.
private QuestionModelInterface getModelMock(Integer id, String text, Integer questionTypeId, Integer topicId) {
final QuestionModelInterface questionModel = Mockito.mock(QuestionModelInterface.class);
Mockito.when(questionModel.getId()).thenReturn(id);
Mockito.when(questionModel.getText()).thenReturn(text);
Mockito.when(questionModel.getQuestionType()).thenReturn(new QuestionTypeModelEmpty(questionTypeId));
Mockito.when(questionModel.getTopic()).thenReturn(new TopicModelEmpty(topicId));
Mockito.when(questionModel.getAnswers()).thenReturn(new ModelsListEmpty());
return questionModel;
}
use of easytests.core.models.empty.ModelsListEmpty 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;
}
Aggregations