Last active
August 29, 2015 14:00
-
-
Save TurhanOz/81f79b7a00a2d8c47c4e to your computer and use it in GitHub Desktop.
Square/Phrase/EnhanceTests
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
@Test(expected = NullPointerException.class) | |
public void shouldThrowNullPointerException() throws Exception { | |
Foo foo = new Foo(null); | |
foo.bar(null); | |
} |
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
@Rule | |
public ExpectedException thrown = ExpectedException.none(); | |
@Test | |
public void loneCurlyBraceIsAMistake() { | |
thrown.expect(IllegalArgumentException.class); | |
thrown.expectMessage("Unexpected character ' '; expected key."); | |
from("hi { {age}."); | |
} |
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
@Test(expected = IllegalArgumentException.class) | |
public void loneCurlyBraceIsAMistake() { | |
from("hi { {age}."); | |
} |
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
@Test public void loneCurlyBraceIsAMistake() { | |
try { | |
from("hi { {age}."); | |
fail("Expected IllegalArgumentException"); | |
} catch (IllegalArgumentException e) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment