From 24ab30697da826cf07112482d928c9e84a193537 Mon Sep 17 00:00:00 2001 From: SvetlanaTselikova Date: Sat, 21 Oct 2017 00:41:04 +0300 Subject: [PATCH 1/2] improve code coverage of AnswersOptions --- .../core/options/AnswersOptionsTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/test/java/easytests/core/options/AnswersOptionsTest.java b/src/test/java/easytests/core/options/AnswersOptionsTest.java index 6dba98226..f21ac26cf 100644 --- a/src/test/java/easytests/core/options/AnswersOptionsTest.java +++ b/src/test/java/easytests/core/options/AnswersOptionsTest.java @@ -2,6 +2,7 @@ import easytests.core.models.*; import easytests.core.models.empty.QuestionModelEmpty; +import easytests.core.services.AnswersServiceInterface; import easytests.core.services.QuestionsServiceInterface; import java.util.ArrayList; import java.util.List; @@ -116,7 +117,32 @@ public void testWithRelationsOnModelsList() throws Exception { verify(answersModels.get(1)).setQuestion(questionModelSecond); } + @Test + public void testSaveWithRelations() throws Exception { + + final AnswerModelInterface answerModel = Mockito.mock(AnswerModelInterface.class); + + final AnswersOptionsInterface answersOptions = new AnswersOptions(); + answersOptions.saveWithRelations(answerModel); + + + } + + @Test + public void testDeleteWithRelations() throws Exception { + + final AnswerModelInterface answerModel = Mockito.mock(AnswerModelInterface.class); + + final AnswersServiceInterface answersService = Mockito.mock(AnswersServiceInterface.class); + final AnswersOptionsInterface answersOptions = new AnswersOptions(); + answersOptions.setAnswersService(answersService); + answersOptions.deleteWithRelations(answerModel); + + + + + } @Test public void testSaveDeleteWithQuestion() { From 839fee3d80c01e9506504854fc87447b36a11bee Mon Sep 17 00:00:00 2001 From: SvetlanaTselikova Date: Wed, 25 Oct 2017 19:27:19 +0300 Subject: [PATCH 2/2] changes in testDeleteWithRelations --- src/test/java/easytests/core/options/AnswersOptionsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/easytests/core/options/AnswersOptionsTest.java b/src/test/java/easytests/core/options/AnswersOptionsTest.java index f21ac26cf..f67715a05 100644 --- a/src/test/java/easytests/core/options/AnswersOptionsTest.java +++ b/src/test/java/easytests/core/options/AnswersOptionsTest.java @@ -138,7 +138,7 @@ public void testDeleteWithRelations() throws Exception { final AnswersOptionsInterface answersOptions = new AnswersOptions(); answersOptions.setAnswersService(answersService); answersOptions.deleteWithRelations(answerModel); - + verify(answersService).delete(answerModel);