|
|
@@ -4,149 +4,149 @@ import org.junit.Ignore;
|
|
4
|
4
|
import static org.junit.Assert.assertEquals;
|
|
5
|
5
|
|
|
6
|
6
|
public class KindergartenGardenTest {
|
|
7
|
|
- @Test
|
|
8
|
|
- public void singleStudent() {
|
|
9
|
|
- String student = "Alice";
|
|
10
|
|
- String plants = "RC\nGG";
|
|
11
|
|
- String[] expected = {"radishes", "clover", "grass", "grass"};
|
|
12
|
|
-
|
|
13
|
|
- assertEquals(expected, new KindergartenGarden(plants)
|
|
14
|
|
- .getPlantsOfStudent(student));
|
|
15
|
|
- }
|
|
16
|
|
-
|
|
17
|
|
- @Ignore("Remove to run test")
|
|
18
|
|
- @Test
|
|
19
|
|
- public void singleStudent2() {
|
|
20
|
|
- String student = "Alice";
|
|
|
7
|
+ @Test
|
|
|
8
|
+ public void singleStudent() {
|
|
|
9
|
+ String student = "Alice";
|
|
|
10
|
+ String plants = "RC\nGG";
|
|
|
11
|
+ String[] expected = {"radishes", "clover", "grass", "grass"};
|
|
|
12
|
+
|
|
|
13
|
+ assertEquals(expected, new KindergartenGarden(plants)
|
|
|
14
|
+ .getPlantsOfStudent(student));
|
|
|
15
|
+ }
|
|
|
16
|
+
|
|
|
17
|
+ @Ignore("Remove to run test")
|
|
|
18
|
+ @Test
|
|
|
19
|
+ public void singleStudent2() {
|
|
|
20
|
+ String student = "Alice";
|
|
21
|
21
|
String plants = "VC\nRC";
|
|
22
|
22
|
String[] expected = {"violets", "clover", "radishes", "clover"};
|
|
23
|
23
|
|
|
24
|
24
|
assertEquals(expected, new KindergartenGarden(plants)
|
|
25
|
|
- .getPlantsOfStudent(student));
|
|
26
|
|
- }
|
|
|
25
|
+ .getPlantsOfStudent(student));
|
|
|
26
|
+ }
|
|
27
|
27
|
|
|
28
|
|
- @Ignore("Remove to run test")
|
|
29
|
|
- @Test
|
|
30
|
|
- public void twoStudents() {
|
|
31
|
|
- String student = "Bob";
|
|
|
28
|
+ @Ignore("Remove to run test")
|
|
|
29
|
+ @Test
|
|
|
30
|
+ public void twoStudents() {
|
|
|
31
|
+ String student = "Bob";
|
|
32
|
32
|
String plants = "VVCG\nVVRC";
|
|
33
|
33
|
String[] expected = {"clover", "grass", "radishes", "clover"};
|
|
34
|
34
|
|
|
35
|
35
|
assertEquals(expected, new KindergartenGarden(plants)
|
|
36
|
|
- .getPlantsOfStudent(student));
|
|
37
|
|
- }
|
|
|
36
|
+ .getPlantsOfStudent(student));
|
|
|
37
|
+ }
|
|
38
|
38
|
|
|
39
|
|
- @Ignore("Remove to run test")
|
|
40
|
|
- @Test
|
|
41
|
|
- public void oneGardenSecondStudent() {
|
|
42
|
|
- String student = "Bob";
|
|
|
39
|
+ @Ignore("Remove to run test")
|
|
|
40
|
+ @Test
|
|
|
41
|
+ public void oneGardenSecondStudent() {
|
|
|
42
|
+ String student = "Bob";
|
|
43
|
43
|
String plants = "VVCCGG\nVVCCGG";
|
|
44
|
44
|
String[] expected = {"clover", "clover", "clover", "clover"};
|
|
45
|
45
|
|
|
46
|
46
|
assertEquals(expected, new KindergartenGarden(plants)
|
|
47
|
|
- .getPlantsOfStudent(student));
|
|
48
|
|
- }
|
|
|
47
|
+ .getPlantsOfStudent(student));
|
|
|
48
|
+ }
|
|
49
|
49
|
|
|
50
|
|
- @Ignore("Remove to run test")
|
|
51
|
|
- @Test
|
|
52
|
|
- public void oneGardenThirdStudent() {
|
|
53
|
|
- String student = "Charlie";
|
|
|
50
|
+ @Ignore("Remove to run test")
|
|
|
51
|
+ @Test
|
|
|
52
|
+ public void oneGardenThirdStudent() {
|
|
|
53
|
+ String student = "Charlie";
|
|
54
|
54
|
String plants = "VVCCGG\nVVCCGG";
|
|
55
|
55
|
String[] expected = {"grass", "grass", "grass", "grass"};
|
|
56
|
56
|
|
|
57
|
57
|
assertEquals(expected, new KindergartenGarden(plants)
|
|
58
|
|
- .getPlantsOfStudent(student));
|
|
59
|
|
- }
|
|
60
|
|
-
|
|
61
|
|
- @Ignore("Remove to run test")
|
|
62
|
|
- @Test
|
|
63
|
|
- public void fullGardenFirstStudent() {
|
|
64
|
|
- String student = "Alice";
|
|
|
58
|
+ .getPlantsOfStudent(student));
|
|
|
59
|
+ }
|
|
|
60
|
+
|
|
|
61
|
+ @Ignore("Remove to run test")
|
|
|
62
|
+ @Test
|
|
|
63
|
+ public void fullGardenFirstStudent() {
|
|
|
64
|
+ String student = "Alice";
|
|
65
|
65
|
String plants = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV";
|
|
66
|
66
|
String[] expected = {"violets", "radishes", "violets", "radishes"};
|
|
67
|
67
|
|
|
68
|
68
|
assertEquals(expected, new KindergartenGarden(plants)
|
|
69
|
|
- .getPlantsOfStudent(student));
|
|
70
|
|
- }
|
|
71
|
|
-
|
|
72
|
|
- @Ignore("Remove to run test")
|
|
73
|
|
- @Test
|
|
74
|
|
- public void fullGardenSecondStudent() {
|
|
75
|
|
- String student = "Bob";
|
|
|
69
|
+ .getPlantsOfStudent(student));
|
|
|
70
|
+ }
|
|
|
71
|
+
|
|
|
72
|
+ @Ignore("Remove to run test")
|
|
|
73
|
+ @Test
|
|
|
74
|
+ public void fullGardenSecondStudent() {
|
|
|
75
|
+ String student = "Bob";
|
|
76
|
76
|
String plants = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV";
|
|
77
|
77
|
String[] expected = {"clover", "grass", "clover", "clover"};
|
|
78
|
78
|
|
|
79
|
79
|
assertEquals(expected, new KindergartenGarden(plants)
|
|
80
|
|
- .getPlantsOfStudent(student));
|
|
81
|
|
- }
|
|
82
|
|
-
|
|
83
|
|
- @Ignore("Remove to run test")
|
|
84
|
|
- @Test
|
|
85
|
|
- public void fullGardenSecondToLastStudent() {
|
|
86
|
|
- String student = "Kincaid";
|
|
|
80
|
+ .getPlantsOfStudent(student));
|
|
|
81
|
+ }
|
|
|
82
|
+
|
|
|
83
|
+ @Ignore("Remove to run test")
|
|
|
84
|
+ @Test
|
|
|
85
|
+ public void fullGardenSecondToLastStudent() {
|
|
|
86
|
+ String student = "Kincaid";
|
|
87
|
87
|
String plants = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV";
|
|
88
|
88
|
String[] expected = {"grass", "clover", "clover", "grass"};
|
|
89
|
89
|
|
|
90
|
90
|
assertEquals(expected, new KindergartenGarden(plants)
|
|
91
|
|
- .getPlantsOfStudent(student));
|
|
92
|
|
- }
|
|
93
|
|
-
|
|
94
|
|
- @Ignore("Remove to run test")
|
|
95
|
|
- @Test
|
|
96
|
|
- public void fullGardenLastStudent() {
|
|
97
|
|
- String student = "Larry";
|
|
|
91
|
+ .getPlantsOfStudent(student));
|
|
|
92
|
+ }
|
|
|
93
|
+
|
|
|
94
|
+ @Ignore("Remove to run test")
|
|
|
95
|
+ @Test
|
|
|
96
|
+ public void fullGardenLastStudent() {
|
|
|
97
|
+ String student = "Larry";
|
|
98
|
98
|
String plants = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV";
|
|
99
|
99
|
String[] expected = {"grass", "violets", "clover", "violets"};
|
|
100
|
100
|
|
|
101
|
101
|
assertEquals(expected, new KindergartenGarden(plants)
|
|
102
|
|
- .getPlantsOfStudent(student));
|
|
103
|
|
- }
|
|
104
|
|
-
|
|
105
|
|
- @Ignore("Remove to run test")
|
|
106
|
|
- @Test
|
|
107
|
|
- public void customStudentGardenFirstStudent() {
|
|
108
|
|
- String[] studentArray = {"Samantha", "Patricia", "Xander", "Roger"};
|
|
109
|
|
- String student = "Patricia";
|
|
|
102
|
+ .getPlantsOfStudent(student));
|
|
|
103
|
+ }
|
|
|
104
|
+
|
|
|
105
|
+ @Ignore("Remove to run test")
|
|
|
106
|
+ @Test
|
|
|
107
|
+ public void customStudentGardenFirstStudent() {
|
|
|
108
|
+ String[] studentArray = {"Samantha", "Patricia", "Xander", "Roger"};
|
|
|
109
|
+ String student = "Patricia";
|
|
110
|
110
|
String plants = "VCRRGVRG\nRVGCCGCV";
|
|
111
|
111
|
String[] expected = {"violets", "clover", "radishes", "violets"};
|
|
112
|
112
|
|
|
113
|
113
|
assertEquals(expected, new KindergartenGarden(plants, studentArray)
|
|
114
|
|
- .getPlantsOfStudent(student));
|
|
115
|
|
- }
|
|
116
|
|
-
|
|
117
|
|
- @Ignore("Remove to run test")
|
|
118
|
|
- @Test
|
|
119
|
|
- public void customStudentGardenSecondStudent() {
|
|
120
|
|
- String[] studentArray = {"Samantha", "Patricia", "Xander", "Roger"};
|
|
121
|
|
- String student = "Roger";
|
|
|
114
|
+ .getPlantsOfStudent(student));
|
|
|
115
|
+ }
|
|
|
116
|
+
|
|
|
117
|
+ @Ignore("Remove to run test")
|
|
|
118
|
+ @Test
|
|
|
119
|
+ public void customStudentGardenSecondStudent() {
|
|
|
120
|
+ String[] studentArray = {"Samantha", "Patricia", "Xander", "Roger"};
|
|
|
121
|
+ String student = "Roger";
|
|
122
|
122
|
String plants = "VCRRGVRG\nRVGCCGCV";
|
|
123
|
123
|
String[] expected = {"radishes", "radishes", "grass", "clover"};
|
|
124
|
124
|
|
|
125
|
125
|
assertEquals(expected, new KindergartenGarden(plants, studentArray)
|
|
126
|
|
- .getPlantsOfStudent(student));
|
|
127
|
|
- }
|
|
128
|
|
-
|
|
129
|
|
- @Ignore("Remove to run test")
|
|
130
|
|
- @Test
|
|
131
|
|
- public void customStudentGardenThirdStudent() {
|
|
132
|
|
- String[] studentArray = {"Samantha", "Patricia", "Xander", "Roger"};
|
|
133
|
|
- String student = "Samantha";
|
|
|
126
|
+ .getPlantsOfStudent(student));
|
|
|
127
|
+ }
|
|
|
128
|
+
|
|
|
129
|
+ @Ignore("Remove to run test")
|
|
|
130
|
+ @Test
|
|
|
131
|
+ public void customStudentGardenThirdStudent() {
|
|
|
132
|
+ String[] studentArray = {"Samantha", "Patricia", "Xander", "Roger"};
|
|
|
133
|
+ String student = "Samantha";
|
|
134
|
134
|
String plants = "VCRRGVRG\nRVGCCGCV";
|
|
135
|
135
|
String[] expected = {"grass", "violets", "clover", "grass"};
|
|
136
|
136
|
|
|
137
|
137
|
assertEquals(expected, new KindergartenGarden(plants, studentArray)
|
|
138
|
|
- .getPlantsOfStudent(student));
|
|
139
|
|
- }
|
|
140
|
|
-
|
|
141
|
|
- @Ignore("Remove to run test")
|
|
142
|
|
- @Test
|
|
143
|
|
- public void customStudentGardenFourthStudent() {
|
|
144
|
|
- String[] studentArray = {"Samantha", "Patricia", "Xander", "Roger"};
|
|
145
|
|
- String student = "Xander";
|
|
|
138
|
+ .getPlantsOfStudent(student));
|
|
|
139
|
+ }
|
|
|
140
|
+
|
|
|
141
|
+ @Ignore("Remove to run test")
|
|
|
142
|
+ @Test
|
|
|
143
|
+ public void customStudentGardenFourthStudent() {
|
|
|
144
|
+ String[] studentArray = {"Samantha", "Patricia", "Xander", "Roger"};
|
|
|
145
|
+ String student = "Xander";
|
|
146
|
146
|
String plants = "VCRRGVRG\nRVGCCGCV";
|
|
147
|
147
|
String[] expected = {"radishes", "grass", "clover", "violets"};
|
|
148
|
148
|
|
|
149
|
149
|
assertEquals(expected, new KindergartenGarden(plants, studentArray)
|
|
150
|
|
- .getPlantsOfStudent(student));
|
|
151
|
|
- }
|
|
|
150
|
+ .getPlantsOfStudent(student));
|
|
|
151
|
+ }
|
|
152
|
152
|
}
|