Quotessence
Home / Quotes / Quote / Image

Quote image editor Lasse Koskela

Back to previous page

“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) { } }” — Lasse Koskela

Quote 1080 x 1350 Instagram portrait
More
Platforms
Pure ratios
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) { } }
— Lasse Koskela