use of easytests.core.models.TesteeModelInterface in project easy-tests by malinink.
the class TesteesServiceTest method testFindByQuizAbsentModel.
@Test
public void testFindByQuizAbsentModel() throws Exception {
final Integer quizId = 5;
given(this.testeesMapper.findByQuizId(quizId)).willReturn(null);
final QuizModelInterface quizModel = Mockito.mock(QuizModelInterface.class);
Mockito.when(quizModel.getId()).thenReturn(quizId);
final TesteeModelInterface testeeModel = this.testeesService.findByQuiz(quizModel);
Assert.assertNull(testeeModel);
}
use of easytests.core.models.TesteeModelInterface in project easy-tests by malinink.
the class TesteesServiceTest method testDeleteUnidentifiedModel.
@Test
public void testDeleteUnidentifiedModel() throws Exception {
final TesteeModelInterface testeeModel = Models.createTesteeModel(null, "FirstName", "LastName", "Surname", 301, 1);
exception.expect(DeleteUnidentifiedModelException.class);
this.testeesService.delete(testeeModel);
}
use of easytests.core.models.TesteeModelInterface in project easy-tests by malinink.
the class TesteesServiceTest method testFindAbsentModel.
@Test
public void testFindAbsentModel() throws Exception {
final Integer id = 10;
final TesteeModelInterface testeeModel = this.testeesService.find(id);
Assert.assertEquals(null, testeeModel);
}
use of easytests.core.models.TesteeModelInterface 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.TesteeModelInterface in project easy-tests by malinink.
the class TesteesService method map.
private TesteeModelInterface map(TesteeEntity testeeEntity) {
if (testeeEntity == null) {
return null;
}
final TesteeModelInterface testeeModel = new TesteeModel();
testeeModel.map(testeeEntity);
return testeeModel;
}
Aggregations