IgnoredTestCaseTest.java :  » IntelliJ » dontmakemetest » com » thoughtworks » shadow » junit » Java Open Source

Java Open Source » IntelliJ » dontmakemetest 
dontmakemetest » com » thoughtworks » shadow » junit » IgnoredTestCaseTest.java
package com.thoughtworks.shadow.junit;

import com.thoughtworks.shadow.TestShadowResult;
import junit.framework.TestCase;
import junit.framework.TestResult;

public class IgnoredTestCaseTest extends TestCase {
    private IgnoredTestCase test;

    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());
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.