New Fetch
This commit is contained in:
5
java/two-fer/src/main/java/Twofer.java
Normal file
5
java/two-fer/src/main/java/Twofer.java
Normal file
@@ -0,0 +1,5 @@
|
||||
public class Twofer {
|
||||
public String twofer(String name) {
|
||||
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
|
||||
}
|
||||
}
|
41
java/two-fer/src/test/java/TwoferTest.java
Normal file
41
java/two-fer/src/test/java/TwoferTest.java
Normal file
@@ -0,0 +1,41 @@
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class TwoferTest {
|
||||
|
||||
private Twofer twofer;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
twofer = new Twofer();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noNameGiven() {
|
||||
String input = null;
|
||||
String expected = "One for you, one for me.";
|
||||
|
||||
assertEquals(expected, twofer.twofer(input));
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user