Created
September 25, 2012 19:24
-
-
Save delucas/3783899 to your computer and use it in GitHub Desktop.
Ejemplo de Testing sobre Excepciones en Groovy - JUnit3 y JUnit4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExceptionTestsJUnit3 extends GroovyTestCase { | |
void testDebeArrojarArithmeticExcepcion() { | |
shouldFail(ArithmeticException) { | |
1 / 0 | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test | |
class ExceptionTestsJUnit4 { | |
@Test(expected=ArithmeticException.class) | |
public void testDebeArrojarArithmeticExcepcion() { | |
1 / 0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment