use of easytests.core.models.empty.QuestionTypeModelEmpty in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsSupport method assertEquals.
public void assertEquals(IssueStandardQuestionTypeOptionEntity expected, IssueStandardQuestionTypeOptionModelInterface actual) {
assertEquals(actual, expected);
Assert.assertEquals(new QuestionTypeModelEmpty(expected.getQuestionTypeId()), actual.getQuestionType());
Assert.assertEquals(new IssueStandardModelEmpty(expected.getIssueStandardId()), actual.getIssueStandard());
}
use of easytests.core.models.empty.QuestionTypeModelEmpty 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.QuestionTypeModelEmpty in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionEntityTest method testMap.
@Test
public void testMap() throws Exception {
final Integer id = 3;
final Integer questionTypeId = 4;
final Integer minQuestions = 10;
final Integer maxQuestions = 20;
final Integer timeLimit = 600;
final Integer issueStandardId = 12;
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Mockito.mock(IssueStandardQuestionTypeOptionModelInterface.class);
Mockito.when(questionTypeOptionModel.getId()).thenReturn(id);
Mockito.when(questionTypeOptionModel.getQuestionType()).thenReturn(new QuestionTypeModelEmpty(questionTypeId));
Mockito.when(questionTypeOptionModel.getMinQuestions()).thenReturn(minQuestions);
Mockito.when(questionTypeOptionModel.getMaxQuestions()).thenReturn(maxQuestions);
Mockito.when(questionTypeOptionModel.getTimeLimit()).thenReturn(timeLimit);
Mockito.when(questionTypeOptionModel.getIssueStandard()).thenReturn(new IssueStandardModelEmpty(issueStandardId));
final IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = new IssueStandardQuestionTypeOptionEntity();
questionTypeOptionEntity.map(questionTypeOptionModel);
Assert.assertEquals(id, questionTypeOptionEntity.getId());
Assert.assertEquals(questionTypeId, questionTypeOptionEntity.getQuestionTypeId());
Assert.assertEquals(minQuestions, questionTypeOptionEntity.getMinQuestions());
Assert.assertEquals(maxQuestions, questionTypeOptionEntity.getMaxQuestions());
Assert.assertEquals(timeLimit, questionTypeOptionEntity.getTimeLimit());
Assert.assertEquals(issueStandardId, questionTypeOptionEntity.getIssueStandardId());
}
use of easytests.core.models.empty.QuestionTypeModelEmpty in project easy-tests by malinink.
the class QuestionsServiceTest method testSaveModel.
@Test
public void testSaveModel() throws Exception {
final QuestionModelInterface questionModel = new QuestionModel();
questionModel.setText("test1");
questionModel.setQuestionType(new QuestionTypeModelEmpty(1));
questionModel.setAnswers(new ModelsListEmpty());
questionModel.setTopic(new TopicModelEmpty(1));
this.questionsService.save(questionModel);
final QuestionModelInterface foundedQuestionModel = this.questionsService.find(questionModel.getId());
Assert.assertEquals(questionModel, foundedQuestionModel);
}
use of easytests.core.models.empty.QuestionTypeModelEmpty in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionModel method map.
public void map(IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity) {
this.setId(questionTypeOptionEntity.getId());
this.setQuestionType(new QuestionTypeModelEmpty(questionTypeOptionEntity.getQuestionTypeId()));
this.setMinQuestions(questionTypeOptionEntity.getMinQuestions());
this.setMaxQuestions(questionTypeOptionEntity.getMaxQuestions());
this.setTimeLimit(questionTypeOptionEntity.getTimeLimit());
this.setIssueStandard(new IssueStandardModelEmpty(questionTypeOptionEntity.getIssueStandardId()));
}
Aggregations