|
@@ -9,49 +9,54 @@ import org.junit.Test;
|
9
|
9
|
|
10
|
10
|
public class SundayTest {
|
11
|
11
|
|
12
|
|
- Farm farm;
|
13
|
|
- // int cornFirstCount;
|
14
|
|
- // int tomatoFirstCount;
|
|
12
|
+ Farm farm = new Farm();;
|
|
13
|
+ private int cornFirstCount;
|
|
14
|
+ private int tomatoFirstCount;
|
15
|
15
|
|
16
|
16
|
|
17
|
17
|
@Before
|
18
|
18
|
public void setup(){
|
19
|
19
|
farm = new Farm();
|
20
|
|
- // cornFirstCount = farm.getCorn().getFoodCount();
|
21
|
|
- // tomatoFirstCount = farm.getTomato().getFoodCount();
|
22
|
|
- //farm.populateFarm();
|
23
|
|
- // farm.morningRoutine();
|
|
20
|
+ cornFirstCount = farm.getCorn().getFoodCount();
|
|
21
|
+ tomatoFirstCount = farm.getTomato().getFoodCount();
|
|
22
|
+ farm.populateFarm();
|
|
23
|
+ farm.morningRoutine();
|
24
|
24
|
|
25
|
25
|
}
|
26
|
26
|
|
27
|
27
|
|
28
|
28
|
@Test
|
29
|
29
|
public void horseRidetest(){
|
30
|
|
- farm.populateFarm();
|
31
|
|
- farm.morningRoutine();
|
|
30
|
+
|
|
31
|
+ // farm.populateFarm();
|
|
32
|
+ //farm.morningRoutine();
|
32
|
33
|
String expected = "Horse number 1 has been ridden today. \nHorse number 2 has been ridden today. \nHorse number 3 has been ridden today. \nHorse number 4 has been ridden today. \nHorse number 5 has been ridden today. \nHorse number 6 has been ridden today. \nHorse number 7 has been ridden today. \nHorse number 8 has been ridden today. \nHorse number 9 has been ridden today. \n";
|
33
|
34
|
String actual = farm.getHorse().getRideResult();
|
34
|
35
|
Assert.assertEquals(expected, actual);
|
35
|
36
|
}
|
36
|
|
- @Test
|
37
|
|
- public void tomatoEatTest(){
|
38
|
|
- int tomatoFirstCount = farm.getTomato().getFoodCount();
|
39
|
|
- farm.populateFarm();
|
40
|
|
- farm.morningRoutine();
|
41
|
|
- int secondCount = farm.getTomato().getFoodCount();
|
42
|
|
- int expected = 6;
|
43
|
|
- int actual = tomatoFirstCount-secondCount;
|
44
|
|
- Assert.assertEquals(expected, actual);
|
45
|
|
- }
|
|
37
|
+
|
46
|
38
|
@Test
|
47
|
39
|
public void cornEatTest(){
|
48
|
|
- int cornFirstCount = farm.getCorn().getFoodCount();
|
49
|
|
- farm.populateFarm();
|
50
|
|
- farm.morningRoutine();
|
|
40
|
+
|
|
41
|
+ // int cornFirstCount = farm.getCorn().getFoodCount();
|
|
42
|
+ // farm.populateFarm();
|
|
43
|
+ // farm.morningRoutine();
|
51
|
44
|
int secondCount = farm.getCorn().getFoodCount();
|
52
|
45
|
int expected = 30;
|
53
|
46
|
int actual = cornFirstCount-secondCount;
|
54
|
47
|
Assert.assertEquals(expected, actual);
|
55
|
48
|
}
|
|
49
|
+ @Test
|
|
50
|
+ public void tomatoEatTest(){
|
|
51
|
+
|
|
52
|
+ // int tomatoFirstCount = farm.getTomato().getFoodCount();
|
|
53
|
+ // farm.populateFarm();
|
|
54
|
+ // farm.morningRoutine();
|
|
55
|
+ int secondCount = farm.getTomato().getFoodCount();
|
|
56
|
+ int expected = 6;
|
|
57
|
+ int actual = tomatoFirstCount-secondCount;
|
|
58
|
+ Assert.assertEquals(expected, actual);
|
|
59
|
+ }
|
|
60
|
+
|
56
|
61
|
|
57
|
62
|
}
|