Code example for TestResult

Methods: errorCountfailureCountrunCountwasSuccessful

0
		TestSuite suite= new TestSuite(NotVoidTestCase.class);
		assertTrue(suite.countTestCases() == 1);
	} 
	public void testOneTestCase() { 
		Test t= new TestSuite(OneTestCase.class);
		t.run(fResult);
		assertTrue(fResult.runCount() == 1);  
		assertTrue(fResult.failureCount() == 0);
		assertTrue(fResult.errorCount() == 0);
		assertTrue(fResult.wasSuccessful());
	} 
	public void testShadowedTests() { 
		TestSuite suite= new TestSuite(OverrideTestCase.class);
		suite.run(fResult);
		assertEquals(1, fResult.runCount());
	} 
	public void testAddTestSuite() { 
		TestSuite suite= new TestSuite();
		suite.addTestSuite(OneTestCase.class);
		suite.run(fResult);
Experience pair programming with AI  Get Codota for Java