|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+import org.junit.Before;
|
|
|
2
|
+import org.junit.Ignore;
|
|
|
3
|
+import org.junit.Test;
|
|
|
4
|
+
|
|
|
5
|
+import static org.junit.Assert.assertEquals;
|
|
|
6
|
+
|
|
|
7
|
+public class TwoferTest {
|
|
|
8
|
+
|
|
|
9
|
+ private Twofer twofer;
|
|
|
10
|
+
|
|
|
11
|
+ @Before
|
|
|
12
|
+ public void setup() {
|
|
|
13
|
+ twofer = new Twofer();
|
|
|
14
|
+ }
|
|
|
15
|
+
|
|
|
16
|
+ @Test
|
|
|
17
|
+ public void noNameGiven() {
|
|
|
18
|
+ String input = null;
|
|
|
19
|
+ String expected = "One for you, one for me.";
|
|
|
20
|
+
|
|
|
21
|
+ assertEquals(expected, twofer.twofer(input));
|
|
|
22
|
+ }
|
|
|
23
|
+
|
|
|
24
|
+ @Test
|
|
|
25
|
+ @Ignore("Remove to run test")
|
|
|
26
|
+ public void aNameGiven() {
|
|
|
27
|
+ String input = "Alice";
|
|
|
28
|
+ String expected = "One for Alice, one for me.";
|
|
|
29
|
+
|
|
|
30
|
+ assertEquals(expected, twofer.twofer(input));
|
|
|
31
|
+ }
|
|
|
32
|
+
|
|
|
33
|
+ @Test
|
|
|
34
|
+ @Ignore("Remove to run test")
|
|
|
35
|
+ public void anotherNameGiven() {
|
|
|
36
|
+ String input = "Bob";
|
|
|
37
|
+ String expected = "One for Bob, one for me.";
|
|
|
38
|
+
|
|
|
39
|
+ assertEquals(expected, twofer.twofer(input));
|
|
|
40
|
+ }
|
|
|
41
|
+}
|