Skip to content

Commit

Permalink
Add unit test showing problem
Browse files Browse the repository at this point in the history
  • Loading branch information
fhoeben committed May 2, 2015
1 parent b2906b7 commit dc6687b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/fitnesse/testsystems/slim/result/SlimExceptionResultTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package fitnesse.testsystems.slim.result;

import fitnesse.testsystems.slim.results.SlimExceptionResult;
import org.junit.Test;

import static org.junit.Assert.*;

public class SlimExceptionResultTest {
@Test
public void otherExceptionRecognized() {
SlimExceptionResult result = new SlimExceptionResult("key", "my normal exception");
assertFalse(result.hasMessage());
assertNull(result.getMessage());
}

@Test
public void messageFound() {
SlimExceptionResult result = new SlimExceptionResult("key", "message:<<Bad things>>");
assertTrue(result.hasMessage());
assertEquals("Bad things", result.getMessage());
}

@Test
public void messageWithNewlineFound() {
SlimExceptionResult result = new SlimExceptionResult("key", "message:<<Bad things\nhappened>>");
assertTrue(result.hasMessage());
assertEquals("Bad things\nhappened", result.getMessage());
}
}

0 comments on commit dc6687b

Please sign in to comment.