Skip to content

Instantly share code, notes, and snippets.

@mkuehle
Last active July 1, 2017 09:14
Show Gist options
  • Save mkuehle/28fed39d3f115247cec7455fc9df38b5 to your computer and use it in GitHub Desktop.
Save mkuehle/28fed39d3f115247cec7455fc9df38b5 to your computer and use it in GitHub Desktop.
static imports JUnit Test
package de.ligahero.news.control;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
public class HTMLBuddyTest {
@Test
public void formatText_shouldBeBold() {
String formatedText = new HTMLBuddy().init("a *b* c").formatText().build();
assertThat(formatedText, equalTo("a <strong>b</strong> c"));
}
@Test
public void formatText_shouldBeStrikethrough() {
String formatedText = new HTMLBuddy().init("a ~b~ c").formatText().build();
assertThat(formatedText, equalTo("a <span class=\"strike\">b</span> c"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment