Search in sources :

Example 1 with QuizModelEmpty

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

Example 2 with QuizModelEmpty

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

Example 3 with QuizModelEmpty

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

Example 4 with QuizModelEmpty

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());
}
Also used : QuizModelEmpty(easytests.core.models.empty.QuizModelEmpty) TesteeModelInterface(easytests.core.models.TesteeModelInterface) Test(org.junit.Test)

Example 5 with QuizModelEmpty

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

Aggregations

QuizModelEmpty (easytests.core.models.empty.QuizModelEmpty)13 Test (org.junit.Test)7 QuestionModelEmpty (easytests.core.models.empty.QuestionModelEmpty)6 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 QuizModelInterface (easytests.core.models.QuizModelInterface)4 TesteeModelInterface (easytests.core.models.TesteeModelInterface)4 QuizzesServiceInterface (easytests.core.services.QuizzesServiceInterface)4 PointModelInterface (easytests.core.models.PointModelInterface)3 ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)3 ArrayList (java.util.ArrayList)3 QuestionModelInterface (easytests.core.models.QuestionModelInterface)2 SolutionModelInterface (easytests.core.models.SolutionModelInterface)2 QuestionsServiceInterface (easytests.core.services.QuestionsServiceInterface)2 SolutionsServiceInterface (easytests.core.services.SolutionsServiceInterface)2 PointEntity (easytests.core.entities.PointEntity)1 TesteeEntity (easytests.core.entities.TesteeEntity)1