@Test
public void testCheckIfConsistenceReportAlreadyExists()
{
ReportContainer container = ReportModelFactory.eINSTANCE.createReportContainer();
ConsistenceReport r = ReportModelFactory.eINSTANCE.createConsistenceReport();
Actor a = URNModelFactory.eINSTANCE.createActor();
ViolationType t = ReportModelFactory.eINSTANCE.createViolationType();
t.setName("TestViolationType");
r.setTypeOfViolation(t);
r.setType(ReportType.VIOLATION);
r.setElement(a);
container.getReports().add(r);
accessLayer.addElement(project, container);
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(null, null, null));
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, null, null));
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, a, null));
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(null, a, t));
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, null, t));
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, a, null));
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(null, null, t));
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(null, a, null));
Actor a2 = URNModelFactory.eINSTANCE.createActor();
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, a2, t));
r.setType(ReportType.IMPACT);
assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, a, t));
r.setType(ReportType.VIOLATION);
assertTrue(reportManager.checkIfConsistenceReportAlreadyExists(project, a, t));
r.setType(ReportType.BAD_SMELL);
assertTrue(reportManager.checkIfConsistenceReportAlreadyExists(project, a, t));
}