Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cobertura does not include results in test-coverage #34

Open
nito90 opened this issue Mar 30, 2017 · 0 comments
Open

Cobertura does not include results in test-coverage #34

nito90 opened this issue Mar 30, 2017 · 0 comments

Comments

@nito90
Copy link

nito90 commented Mar 30, 2017

Hi to all, I use maven plugin Cobertura 2.7. I want to test the below method.

protected void validateCategoryAndAssociatedQuestionType(CategoryQuestionDto dto, Category cat, Question que) {
		
if (!((cat instanceof TriviaCategory && que instanceof TriviaQuestion) || (cat instanceof TestCategory && que instanceof TestQuestion) || (cat instanceof GuessingGameCategory && que instanceof GuessingGameQuestion))) 
{
			
throw new QuestionAndCategoryNotOfTheSameTypeException("Question with id: " + dto.getId().getQuestionId() + " and Category with id: " + dto.getId().getCategoryId() + " are not of the same type");

}
}

and I am testing this with the below test.

@Test(expected = QuestionAndCategoryNotOfTheSameTypeException.class)
	
public void validateCategoryAndAssociatedQuestionTypeFailure6(){
		
                GuessingGameCategory category = new GuessingGameCategory();
		TestQuestion question = new TestQuestion();
		
                question.setId(1);
	        category.setId(1);

		CategoryQuestion pair = new CategoryQuestion(category, question, (short)1);
		service.validateCategoryAndAssociatedQuestionType(new  CategoryQuestionDto().fromEntity(pair), category, question);
	}
``` 

Can someone tell me why this method in coverage report is with red lines?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant