Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Lab 1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
com_1028_labs
Lab 1
Commits
4bd43e72
Commit
4bd43e72
authored
1 year ago
by
joeappleton18
Browse files
Options
Downloads
Patches
Plain Diff
passing tests
parent
79257353
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/l_1/House.java
+5
-2
5 additions, 2 deletions
src/main/java/l_1/House.java
src/test/java/l_1/HouseTest.java
+4
-2
4 additions, 2 deletions
src/test/java/l_1/HouseTest.java
with
9 additions
and
4 deletions
src/main/java/l_1/House.java
+
5
−
2
View file @
4bd43e72
...
@@ -32,8 +32,11 @@ public class House {
...
@@ -32,8 +32,11 @@ public class House {
public
double
getTotalArea
()
{
public
double
getTotalArea
()
{
double
total
=
0.0
;
double
total
=
0.0
;
// missing the loop....
for
(
Room
room:
this
.
rooms
)
{
total
+=
room
.
getArea
();
}
return
total
;
return
total
;
}
}
}
}
This diff is collapsed.
Click to expand it.
src/test/java/l_1/HouseTest.java
+
4
−
2
View file @
4bd43e72
...
@@ -27,10 +27,12 @@ class HouseTest {
...
@@ -27,10 +27,12 @@ class HouseTest {
Lounge
lounge1
=
new
Lounge
(
10.0
);
Lounge
lounge1
=
new
Lounge
(
10.0
);
Lounge
lounge2
=
new
Lounge
(
15.0
);
Lounge
lounge2
=
new
Lounge
(
15.0
);
DiningRoom
dining1
=
new
DiningRoom
(
16.0
);
DiningRoom
dining1
=
new
DiningRoom
(
16.0
);
Bedroom
bedroom
=
new
Bedroom
(
10
);
house
.
addRoom
(
lounge1
);
house
.
addRoom
(
lounge1
);
house
.
addRoom
(
lounge2
);
house
.
addRoom
(
lounge2
);
house
.
addRoom
(
dining1
);
house
.
addRoom
(
dining1
);
house
.
addRoom
(
bedroom
);
}
}
/**
/**
...
@@ -38,7 +40,7 @@ class HouseTest {
...
@@ -38,7 +40,7 @@ class HouseTest {
*/
*/
@Test
@Test
void
testRequirement3
()
{
void
testRequirement3
()
{
assertEquals
(
house
.
howManyRooms
(),
3
);
assertEquals
(
house
.
howManyRooms
(),
4
);
}
}
/**
/**
...
@@ -46,7 +48,7 @@ class HouseTest {
...
@@ -46,7 +48,7 @@ class HouseTest {
*/
;
*/
;
@Test
@Test
void
testRequirement4
()
{
void
testRequirement4
()
{
assertEquals
(
house
.
getTotalArea
(),
4
1.0
);
assertEquals
(
house
.
getTotalArea
(),
5
1.0
);
}
}
@AfterEach
@AfterEach
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment