Skip to content
Snippets Groups Projects
Commit 4bd43e72 authored by joeappleton18's avatar joeappleton18
Browse files

passing tests

parent 79257353
No related branches found
No related tags found
No related merge requests found
......@@ -32,8 +32,11 @@ public class House {
public double getTotalArea() {
double total = 0.0;
// missing the loop....
for (Room room: this.rooms) {
total += room.getArea();
}
return total;
}
}
......@@ -27,10 +27,12 @@ class HouseTest {
Lounge lounge1 = new Lounge(10.0);
Lounge lounge2 = new Lounge(15.0);
DiningRoom dining1 = new DiningRoom(16.0);
Bedroom bedroom = new Bedroom(10);
house.addRoom(lounge1);
house.addRoom(lounge2);
house.addRoom(dining1);
house.addRoom(bedroom);
}
/**
......@@ -38,7 +40,7 @@ class HouseTest {
*/
@Test
void testRequirement3() {
assertEquals(house.howManyRooms(), 3);
assertEquals(house.howManyRooms(), 4);
}
/**
......@@ -46,7 +48,7 @@ class HouseTest {
*/;
@Test
void testRequirement4() {
assertEquals(house.getTotalArea(), 41.0);
assertEquals(house.getTotalArea(), 51.0);
}
@AfterEach
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment