#36 Added images to Plant database
This commit is contained in:
@@ -30,9 +30,7 @@ public class JsonPlantDatabaseTest {
|
||||
List<Plant> testList;
|
||||
try {
|
||||
testList = testDatabase.getPlantList(HardinessZone.ZONE_8A);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (HardinessZoneNotSetException e) {
|
||||
} catch (IOException | HardinessZoneNotSetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Assertions.assertEquals(3, testList.size());
|
||||
@@ -47,11 +45,8 @@ public class JsonPlantDatabaseTest {
|
||||
void getPlantById() {
|
||||
Optional<Plant> testPlant;
|
||||
try {
|
||||
testDatabase.getPlantList(HardinessZone.ZONE_8A);
|
||||
testPlant = testDatabase.getPlantById(1);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (HardinessZoneNotSetException e) {
|
||||
testPlant = testDatabase.getPlantById(HardinessZone.ZONE_8A,1);
|
||||
} catch (IOException | HardinessZoneNotSetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Assertions.assertTrue(testPlant.isPresent());
|
||||
@@ -63,11 +58,8 @@ public class JsonPlantDatabaseTest {
|
||||
void getPlantByIdMustFail() {
|
||||
Optional<Plant> testPlant;
|
||||
try {
|
||||
testDatabase.getPlantList(HardinessZone.ZONE_8A);
|
||||
testPlant = testDatabase.getPlantById(99);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (HardinessZoneNotSetException e) {
|
||||
testPlant = testDatabase.getPlantById(HardinessZone.ZONE_8A,99);
|
||||
} catch (IOException | HardinessZoneNotSetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Assertions.assertFalse(testPlant.isPresent());
|
||||
|
||||
@@ -43,6 +43,7 @@ class PlantListModelTest {
|
||||
20,
|
||||
"summertime onion",
|
||||
"Onion, (Allium cepa), herbaceous biennial plant in the amaryllis family (Amaryllidaceae) grown for its edible bulb. The onion is likely native to southwestern Asia but is now grown throughout the world, chiefly in the temperate zones. Onions are low in nutrients but are valued for their flavour and are used widely in cooking. They add flavour to such dishes as stews, roasts, soups, and salads and are also served as a cooked vegetable.",
|
||||
null,
|
||||
"15,30,2",
|
||||
0,
|
||||
"sandy to loamy, loose soil, free of stones",
|
||||
@@ -53,6 +54,7 @@ class PlantListModelTest {
|
||||
0,
|
||||
"Potato",
|
||||
"The potato is a tuber, round or oval, with small white roots called 'eyes', that are growth buds. The size varies depending on the variety; the colour of the skin can be white, yellow or even purple.",
|
||||
null,
|
||||
"35",
|
||||
6,
|
||||
"sandy",
|
||||
@@ -63,6 +65,7 @@ class PlantListModelTest {
|
||||
1,
|
||||
"Early Carrot",
|
||||
"Carrot, (Daucus carota), herbaceous, generally biennial plant of the Apiaceae family that produces an edible taproot. Among common varieties root shapes range from globular to long, with lower ends blunt to pointed. Besides the orange-coloured roots, white-, yellow-, and purple-fleshed varieties are known.",
|
||||
null,
|
||||
"5,35,2.5",
|
||||
0,
|
||||
"sandy to loamy, loose soil, free of stones",
|
||||
|
||||
Reference in New Issue
Block a user