use of easytests.core.models.IssueModelInterface in project easy-tests by malinink.
the class IssuesOptionsTest method testDeleteWithRelations.
@Test
public void testDeleteWithRelations() throws Exception {
final IssueModelInterface issueModel = Mockito.mock(IssueModelInterface.class);
final IssuesOptionsInterface issuesOptions = new IssuesOptions();
final IssuesServiceInterface issuesService = Mockito.mock(IssuesServiceInterface.class);
final QuizzesServiceInterface quizzesService = Mockito.mock(QuizzesServiceInterface.class);
final QuizzesOptionsInterface quizzesOptions = Mockito.mock(QuizzesOptionsInterface.class);
issuesOptions.setIssuesService(issuesService);
issuesOptions.setQuizzesService(quizzesService);
issuesOptions.withQuizzes(quizzesOptions);
final List<QuizModelInterface> quizzesModels = new ArrayList<>();
quizzesModels.add(Mockito.mock(QuizModelInterface.class));
given(issueModel.getQuizzes()).willReturn(quizzesModels);
final InOrder inOrder = Mockito.inOrder(quizzesService, issuesService);
issuesOptions.deleteWithRelations(issueModel);
inOrder.verify(quizzesService).delete(quizzesModels, quizzesOptions);
inOrder.verify(issuesService).delete(issueModel);
}
use of easytests.core.models.IssueModelInterface in project easy-tests by malinink.
the class IssuesOptionsTest method testWithRelationsOnNull.
@Test
public void testWithRelationsOnNull() throws Exception {
final IssueModelInterface issueModel = null;
final IssuesOptionsInterface issuesOptions = new IssuesOptions();
final SubjectsServiceInterface subjectsService = Mockito.mock(SubjectsServiceInterface.class);
final SubjectsOptionsInterface subjectsOptions = Mockito.mock(SubjectsOptionsInterface.class);
final QuizzesServiceInterface quizzesService = Mockito.mock(QuizzesServiceInterface.class);
final QuizzesOptionsInterface quizzesOptions = Mockito.mock(QuizzesOptionsInterface.class);
issuesOptions.setSubjectsService(subjectsService);
issuesOptions.setQuizzesService(quizzesService);
issuesOptions.withSubject(subjectsOptions);
issuesOptions.withQuizzes(quizzesOptions);
final IssueModelInterface issueModelWithRelations = issuesOptions.withRelations(issueModel);
Assert.assertEquals(null, issueModelWithRelations);
}
Aggregations