|
@@ -10,41 +10,47 @@ import org.junit.Test;
|
10
|
10
|
public class SundayTest {
|
11
|
11
|
|
12
|
12
|
Farm farm;
|
|
13
|
+ // int cornFirstCount;
|
|
14
|
+ // int tomatoFirstCount;
|
|
15
|
+
|
13
|
16
|
|
14
|
17
|
@Before
|
15
|
18
|
public void setup(){
|
16
|
19
|
farm = new Farm();
|
|
20
|
+ // cornFirstCount = farm.getCorn().getFoodCount();
|
|
21
|
+ // tomatoFirstCount = farm.getTomato().getFoodCount();
|
|
22
|
+ //farm.populateFarm();
|
|
23
|
+ // farm.morningRoutine();
|
17
|
24
|
|
18
|
25
|
}
|
19
|
26
|
|
20
|
|
- @Test
|
21
|
|
- public void cornEatTest(){
|
22
|
|
- int firstCount = farm.getCorn().getFoodCount();
|
23
|
|
- farm.populateFarm();
|
24
|
|
- farm.morningRoutine();
|
25
|
|
- int secondCount = farm.getCorn().getFoodCount();
|
26
|
|
- int expected = 30;
|
27
|
|
- int actual = firstCount-secondCount;
|
28
|
|
- Assert.assertEquals(expected, actual);
|
29
|
|
- }
|
30
|
27
|
|
31
|
28
|
@Test
|
32
|
29
|
public void horseRidetest(){
|
33
|
|
- // farm.populateFarm();
|
34
|
|
- // farm.morningRoutine();
|
|
30
|
+ farm.populateFarm();
|
|
31
|
+ farm.morningRoutine();
|
35
|
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 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";
|
36
|
|
- farm.getFroilan().setIsMounted();
|
37
|
|
- String actual = farm.getHorse().ride(farm.getFroilan());
|
|
33
|
+ String actual = farm.getHorse().getRideResult();
|
38
|
34
|
Assert.assertEquals(expected, actual);
|
39
|
35
|
}
|
40
|
36
|
@Test
|
41
|
37
|
public void tomatoEatTest(){
|
42
|
|
- int firstCount = farm.getTomato().getFoodCount();
|
43
|
|
- // farm.populateFarm();
|
44
|
|
- //farm.morningRoutine();
|
|
38
|
+ int tomatoFirstCount = farm.getTomato().getFoodCount();
|
|
39
|
+ farm.populateFarm();
|
|
40
|
+ farm.morningRoutine();
|
45
|
41
|
int secondCount = farm.getTomato().getFoodCount();
|
46
|
42
|
int expected = 6;
|
47
|
|
- int actual = firstCount-secondCount;
|
|
43
|
+ int actual = tomatoFirstCount-secondCount;
|
|
44
|
+ Assert.assertEquals(expected, actual);
|
|
45
|
+ }
|
|
46
|
+ @Test
|
|
47
|
+ public void cornEatTest(){
|
|
48
|
+ int cornFirstCount = farm.getCorn().getFoodCount();
|
|
49
|
+ farm.populateFarm();
|
|
50
|
+ farm.morningRoutine();
|
|
51
|
+ int secondCount = farm.getCorn().getFoodCount();
|
|
52
|
+ int expected = 30;
|
|
53
|
+ int actual = cornFirstCount-secondCount;
|
48
|
54
|
Assert.assertEquals(expected, actual);
|
49
|
55
|
}
|
50
|
56
|
|