|
@@ -12,6 +12,7 @@ public class SundayTest {
|
12
|
12
|
Farm farm = new Farm();;
|
13
|
13
|
private int cornFirstCount;
|
14
|
14
|
private int tomatoFirstCount;
|
|
15
|
+ private int eggFirstCount;
|
15
|
16
|
|
16
|
17
|
|
17
|
18
|
@Before
|
|
@@ -19,6 +20,7 @@ public class SundayTest {
|
19
|
20
|
farm = new Farm();
|
20
|
21
|
cornFirstCount = farm.getCorn().getFoodCount();
|
21
|
22
|
tomatoFirstCount = farm.getTomato().getFoodCount();
|
|
23
|
+ eggFirstCount = farm.getEgg().getFoodCount();
|
22
|
24
|
farm.populateFarm();
|
23
|
25
|
farm.morningRoutine();
|
24
|
26
|
|
|
@@ -27,36 +29,60 @@ public class SundayTest {
|
27
|
29
|
|
28
|
30
|
@Test
|
29
|
31
|
public void horseRidetest(){
|
30
|
|
-
|
31
|
|
- // farm.populateFarm();
|
32
|
|
- //farm.morningRoutine();
|
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";
|
34
|
|
- String actual = farm.getHorse().getRideResult();
|
|
32
|
+ 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 1 has been ridden today. \nHorse number 2 has been ridden today. \nHorse number 3 has been ridden today. \nHorse number 1 has been ridden today. \nHorse number 2 has been ridden today. \nHorse number 3 has been ridden today. \n";
|
|
33
|
+ String actual = farm.getHorse().ride(farm.getFroilan(), farm.getStable1())+farm.getHorse().ride(farm.getFroilan(), farm.getStable2()) +farm.getHorse().ride(farm.getFroilan(), farm.getStable3());
|
35
|
34
|
Assert.assertEquals(expected, actual);
|
36
|
35
|
}
|
37
|
|
-
|
38
|
36
|
@Test
|
39
|
37
|
public void cornEatTest(){
|
40
|
|
-
|
41
|
|
- // int cornFirstCount = farm.getCorn().getFoodCount();
|
42
|
|
- // farm.populateFarm();
|
43
|
|
- // farm.morningRoutine();
|
44
|
38
|
int secondCount = farm.getCorn().getFoodCount();
|
45
|
39
|
int expected = 30;
|
46
|
40
|
int actual = cornFirstCount-secondCount;
|
47
|
41
|
Assert.assertEquals(expected, actual);
|
48
|
42
|
}
|
|
43
|
+
|
49
|
44
|
@Test
|
50
|
|
- public void tomatoEatTest(){
|
|
45
|
+ public void isHorseHappy(){
|
|
46
|
+ String actual = farm.getHorse().makeNoise();
|
|
47
|
+ String expected = "NEIGH!";
|
|
48
|
+ Assert.assertEquals(expected, actual);
|
51
|
49
|
|
52
|
|
- // int tomatoFirstCount = farm.getTomato().getFoodCount();
|
53
|
|
- // farm.populateFarm();
|
54
|
|
- // farm.morningRoutine();
|
|
50
|
+ }
|
|
51
|
+ @Test
|
|
52
|
+ public void tomatoEatTest(){
|
55
|
53
|
int secondCount = farm.getTomato().getFoodCount();
|
56
|
54
|
int expected = 6;
|
57
|
55
|
int actual = tomatoFirstCount-secondCount;
|
58
|
56
|
Assert.assertEquals(expected, actual);
|
59
|
57
|
}
|
|
58
|
+ @Test
|
|
59
|
+ public void eggEatTest(){
|
|
60
|
+ int secondCount = farm.getEgg().getFoodCount();
|
|
61
|
+ int expected = 9;
|
|
62
|
+ int actual = eggFirstCount-secondCount;
|
|
63
|
+ Assert.assertEquals(expected, actual);
|
|
64
|
+ }
|
60
|
65
|
|
|
66
|
+ @Test
|
|
67
|
+ public void plantRow1Test(){
|
|
68
|
+ farm.getFroilan().plant(farm.getRow1(),40);
|
|
69
|
+ int actual = farm.getRow1().getNumberPlanted();
|
|
70
|
+ int expected = 40;
|
|
71
|
+ Assert.assertEquals(expected, actual);
|
|
72
|
+ }
|
61
|
73
|
|
|
74
|
+ @Test
|
|
75
|
+ public void plantRow2Test(){
|
|
76
|
+ farm.getFreelan().plant(farm.getRow2(),40);
|
|
77
|
+ int actual = farm.getRow2().getNumberPlanted();
|
|
78
|
+ int expected = 40;
|
|
79
|
+ Assert.assertEquals(expected, actual);
|
|
80
|
+ }
|
|
81
|
+ @Test
|
|
82
|
+ public void plantRow3Test(){
|
|
83
|
+ farm.getFreelan().plant(farm.getRow3(),40);
|
|
84
|
+ int actual = farm.getRow3().getNumberPlanted();
|
|
85
|
+ int expected = 40;
|
|
86
|
+ Assert.assertEquals(expected, actual);
|
|
87
|
+ }
|
62
|
88
|
}
|