“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

163 ratings, average rating, 10 reviews
Open Preview
Browse By Tag
- love (100689)
- life (78893)
- inspirational (75357)
- humor (44114)
- philosophy (30696)
- inspirational-quotes (28602)
- god (26783)
- truth (24573)
- wisdom (24365)
- romance (24197)
- poetry (23079)
- life-lessons (22231)
- quotes (20511)
- death (20451)
- happiness (18880)
- hope (18394)
- faith (18267)
- inspiration (17186)
- spirituality (15580)
- relationships (15365)
- religion (15311)
- motivational (15224)
- life-quotes (15146)
- love-quotes (15020)
- writing (14881)
- success (14127)
- motivation (13062)
- travel (12946)
- time (12783)
- science (12003)