Skip to content

Commit cfdb19d

Browse files
committed
feat: Added Zion's Bedroom Object and Test to lesson_16
1 parent a3a21bb commit cfdb19d

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
public class bedroom {
2+
//enum for bed sizes
3+
enum MattressSize {
4+
TWIN, QUEEN, KING
5+
}
6+
7+
8+
// Member variables
9+
private int numberOfWalls;
10+
private int numberOfWindows;
11+
private String colorOfWall;
12+
private boolean isOutletWorking;
13+
private MattressSize bedSize;
14+
15+
16+
17+
// HashMap<String,String>drawers;
18+
//code 14 to 17 put lines
19+
20+
// drawers.put("Drawer1", "Shirts");
21+
// drawers.put("Drawer2", "Socks");
22+
// drawers.put("Drawer3", "PJs");
23+
// drawers.put("Drawer4", "Underwear");
24+
25+
//Constructor
26+
public Bedroom(int numberOfWalls, int numberOfWindows, String colorOfWall, boolean isOutletWorking, MattressSize bedSize) {
27+
this.numberOfWalls = numberOfWalls;
28+
this.numberOfWindows = numberOfWindows;
29+
this.colorOfWall = colorOfWall;
30+
this.isOutletWorking = isOutletWorking;
31+
this.bedSize = bedSize;
32+
}
33+
34+
//Getters and Setters for each member variable
35+
public int getNumberOfWalls() {
36+
return numberOfWalls;
37+
}
38+
public void setNumberOfWalls(int numberOfWalls) {
39+
this.numberOfWalls=numberOfWalls;
40+
}
41+
public int getNumberOfWindows() {
42+
return numberOfWindows;
43+
}
44+
public void setNumberOfWindows(int numberOfWindows) {
45+
this.numberOfWindows=numberOfWindows;
46+
}
47+
public String getColorOfWall() {
48+
return ColorOfWall;
49+
}
50+
public void setColorOfWall(String colorOfWall) {
51+
this.colorOfWall=colorOfWall;
52+
}
53+
public boolean isOutletWorking() {
54+
return isOutletWorking;
55+
}
56+
public void setOutletWorking(boolean outletWorking) {
57+
isOutletWorking=outletWorking;
58+
}
59+
public MattressSize getBedSize() {
60+
return bedSize;
61+
}
62+
public void setBedSize(MattressSize bedSize) {
63+
this.bedSize=bedSize;
64+
}
65+
66+
}
67+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
public class bedroomTest {
2+
import org.junit.jupiter.api.Test;
3+
4+
public class BedroomTest {
5+
6+
@Test
7+
public void tesGetColor(){
8+
Bedroom.getColor();
9+
var coloris="green";
10+
}
11+
@Test
12+
public void testGetColor() {
13+
Bedroom bedroom = new Bedroom("Green", 4, 2, true, Bedroom.MattressSize.KING);
14+
String color = bedroom.getwallColor(); //access color of wall
15+
var coloris= "green";
16+
}
17+
18+
@Test
19+
public class Bedroom {
20+
private String Bedroom;
21+
private int value;
22+
23+
public Bedroom("Green", 4){
24+
this.Bedroom=Bedroom;
25+
this.value=value;
26+
}
27+
28+
}
29+
30+
public
31+
}
32+
33+
34+
35+
}

0 commit comments

Comments
 (0)