use of easytests.core.models.empty.QuizModelEmpty in project easy-tests by malinink.
the class PointsSupport method getModelMock.
private PointModelInterface getModelMock(Integer id, Integer quizId, Integer questionId) {
final PointModelInterface pointModel = Mockito.mock(PointModelInterface.class);
Mockito.when(pointModel.getId()).thenReturn(id);
Mockito.when(pointModel.getQuestion()).thenReturn(new QuestionModelEmpty(questionId));
Mockito.when(pointModel.getQuiz()).thenReturn(new QuizModelEmpty(quizId));
Mockito.when(pointModel.getSolutions()).thenReturn(new ModelsListEmpty());
return pointModel;
}
use of easytests.core.models.empty.QuizModelEmpty in project easy-tests by malinink.
the class PointsSupport method assertEquals.
public void assertEquals(PointEntity expected, PointModelInterface actual) {
assertEquals(actual, expected);
Assert.assertEquals(new QuestionModelEmpty(expected.getQuestionId()), actual.getQuestion());
Assert.assertEquals(new ModelsListEmpty(), actual.getSolutions());
Assert.assertEquals(new QuizModelEmpty(expected.getQuizId()), actual.getQuiz());
}
use of easytests.core.models.empty.QuizModelEmpty in project easy-tests by malinink.
the class TesteesSupport method getModelMock.
private TesteeModelInterface getModelMock(Integer id, String firstName, String lastName, String surName, Integer groupNumber, Integer quizId) {
TesteeModelInterface testeeModel = Mockito.mock(TesteeModelInterface.class);
Mockito.when(testeeModel.getId()).thenReturn(id);
Mockito.when(testeeModel.getFirstName()).thenReturn(firstName);
Mockito.when(testeeModel.getLastName()).thenReturn(lastName);
Mockito.when(testeeModel.getSurname()).thenReturn(surName);
Mockito.when(testeeModel.getGroupNumber()).thenReturn(groupNumber);
Mockito.when(testeeModel.getQuiz()).thenReturn(new QuizModelEmpty(quizId));
return testeeModel;
}
use of easytests.core.models.empty.QuizModelEmpty in project easy-tests by malinink.
the class TesteeEntityTest method testMap.
@Test
public void testMap() throws Exception {
final Integer testeeId = 3;
final String firstName = "FirstName";
final String lastName = "LastName";
final String surname = "Surname";
final Integer groupNumber = 307;
final Integer quizId = 3;
final TesteeModelInterface testeeModel = Mockito.mock(TesteeModelInterface.class);
Mockito.when(testeeModel.getId()).thenReturn(testeeId);
Mockito.when(testeeModel.getFirstName()).thenReturn(firstName);
Mockito.when(testeeModel.getLastName()).thenReturn(lastName);
Mockito.when(testeeModel.getSurname()).thenReturn(surname);
Mockito.when(testeeModel.getGroupNumber()).thenReturn(groupNumber);
Mockito.when(testeeModel.getQuiz()).thenReturn(new QuizModelEmpty(quizId));
final TesteeEntity testeeEntity = new TesteeEntity();
testeeEntity.map(testeeModel);
Assert.assertEquals(testeeId, testeeEntity.getId());
Assert.assertEquals(firstName, testeeEntity.getFirstName());
Assert.assertEquals(lastName, testeeEntity.getLastName());
Assert.assertEquals(surname, testeeEntity.getSurname());
Assert.assertEquals(groupNumber, testeeEntity.getGroupNumber());
Assert.assertEquals(quizId, testeeEntity.getQuizId());
}
use of easytests.core.models.empty.QuizModelEmpty in project easy-tests by malinink.
the class TesteeModel method map.
public void map(TesteeEntity testeeEntity) {
this.setId(testeeEntity.getId());
this.setFirstName(testeeEntity.getFirstName());
this.setLastName(testeeEntity.getLastName());
this.setSurname(testeeEntity.getSurname());
this.setGroupNumber(testeeEntity.getGroupNumber());
this.setQuiz(new QuizModelEmpty(testeeEntity.getQuizId()));
}
Aggregations