Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions exercises/practice/two-fer/src/test/java/TwoferTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.assertj.core.api.Assertions.assertThat;

public class TwoferTest {

Expand All @@ -15,39 +15,31 @@ public void setup() {

@Test
public void noNameGiven() {
String input = null;
String expected = "One for you, one for me.";

assertEquals(expected, twofer.twofer(input));
assertThat(twofer.twofer(null))
.isEqualTo("One for you, one for me.");
}

@Ignore("Remove to run test")
@Test
public void aNameGiven() {
String input = "Alice";
String expected = "One for Alice, one for me.";

assertEquals(expected, twofer.twofer(input));
assertThat(twofer.twofer("Alice"))
.isEqualTo("One for Alice, one for me.");
}

@Ignore("Remove to run test")
@Test
public void anotherNameGiven() {
String input = "Bob";
String expected = "One for Bob, one for me.";

assertEquals(expected, twofer.twofer(input));
assertThat(twofer.twofer("Bob"))
.isEqualTo("One for Bob, one for me.");
}

/* Track specific */

@Ignore("Remove to run test")
@Test
public void emptyStringIsNotTheSameAsNull() {
String input = "";
String expected = "One for , one for me.";

assertEquals(expected, twofer.twofer(input));
assertThat(twofer.twofer(""))
.isEqualTo("One for , one for me.");
}

}