“The approach shown... is a common pattern for testing exception-throwing behavior with JUnit.
@Test
public void missingValueRaisesException() throws Exception {
try {
new Template("${foo}").evaluate();
fail("evaluate() should throw an exception if "
+ "a variable was left without a value!");
} catch (MissingValueException expected) {
}
}
”
―
Test Driven: Practical TDD and Acceptance TDD for Java Developers
@Test
public void missingValueRaisesException() throws Exception {
try {
new Template("${foo}").evaluate();
fail("evaluate() should throw an exception if "
+ "a variable was left without a value!");
} catch (MissingValueException expected) {
}
}
Share this quote:
Friends Who Liked This Quote
To see what your friends thought of this quote, please sign up!
0 likes
All Members Who Liked This Quote
None yet!
This Quote Is From
Test Driven: Practical TDD and Acceptance TDD for Java Developers
by
Lasse Koskela163 ratings, average rating, 10 reviews
Open Preview
Browse By Tag
- love (101632)
- life (80152)
- inspirational (76788)
- humor (44851)
- philosophy (31465)
- inspirational-quotes (28579)
- god (27028)
- wisdom (24791)
- truth (24664)
- romance (24650)
- poetry (23653)
- life-lessons (22719)
- quotes (21292)
- death (20760)
- happiness (18971)
- hope (18771)
- faith (18578)
- inspiration (17979)
- spirituality (15973)
- motivational (15940)
- relationships (15808)
- religion (15514)
- life-quotes (15164)
- writing (15058)
- love-quotes (14821)
- success (14168)
- motivation (14005)
- time (12929)
- science (12216)
- motivational-quotes (12099)
