Code example for TestResult

Methods: errorCount, failureCount, runCount

0
    protected void setUp() throws Exception { 
        test = new IgnoredTestCase("className", "methodName");
    } 
 
    public void testShouldDoNothingWhenTestResultIsNotShadowResult() throws Exception { 
        TestResult result = new TestResult();
        test.run(result);
        assertEquals(0, result.runCount());
        assertEquals(0, result.failureCount());
        assertEquals(0, result.errorCount());
    } 
 
    public void testShouldBeIgnoredTest() throws Exception { 
        TestShadowResult result = new TestShadowResult();
        test.run(result);
        assertEquals(1, result.ignoreCount());
        assertEquals(0, result.runCount());
        assertEquals(0, result.failureCount());
        assertEquals(0, result.errorCount());
    } 
}