/** * Test the Remove of Tests and Test by name. Changing a Testcase in an Editor should remove the * testcase from the TestProtocolService to indicate, that the changed test is'nt run yet. */ @Test public void testRemoveChangedTestCaseFromProtocol() { TestProtocolService protocolService = new TestProtocolService(); TestCase testCase = new TestCase(); testCase.setName("TestCase1"); protocolService.set(testCase, new TestResult()); assertNotNull("Expecting a testcase on the protocol service.", protocolService.get(testCase)); protocolService.remove(testCase); assertNull( "Expecting that the testcase is removed from the protocol service.", protocolService.get(testCase)); }
/** Test Protocol on execute a TestSuite that contains referred Testcases. */ @Test public void testRemoveChangedReferedTestCaseFromProtocol() { TestProtocolService protocolService = new TestProtocolService(); TestResult testResult = new TestResult(); TestResult tcTestResult = new TestResult(); tcTestResult.setFullName("MyName"); testResult.add(tcTestResult); TestSuite testSuite = new TestSuite(); protocolService.set(testSuite, testResult); TestCase testCase = new TestCase(); testCase.setName("MyName"); testSuite.addReferredTestStructure(testCase); assertNotNull(protocolService.get(testCase)); protocolService.remove(testCase); assertNull(protocolService.get(testCase)); }