Skip to content

Commit 1771c80

Browse files
committed
fix:changes on getGumball to dispenseGumBall
1 parent ae6c7ef commit 1771c80

File tree

6 files changed

+87
-15
lines changed

6 files changed

+87
-15
lines changed

lesson_16/objects/objects_app/src/main/java/com/codedifferently/lesson16/gumball/GumBallMachine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public void setRandomColors() {
2929
this.colors = colorArray[randIndex]; // Set a random color
3030
}
3131

32-
public int getGumBallCount() {
32+
public int dispenseGumBallCount() {
3333
return this.gumBallCount;
3434
}
3535

36-
public void getGumBall(double quarter) throws invalidCoinInsertedException {
36+
public void dispenseGumBall(double quarter) throws invalidCoinInsertedException {
3737
if (quarter != 0.25) {
3838
throw new invalidCoinInsertedException("You need a quarter!");
3939
}

lesson_16/objects/objects_app/src/test/java/com/codedifferently/lesson16/gumball/GumballMachineTest.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ void setUp() {
1818

1919
@Test
2020
void testGumBallCount_afterDispense() throws invalidCoinInsertedException {
21-
int initialCount = testGumBallMachine.getGumBallCount();
22-
testGumBallMachine.getGumBall(0.25); // Dispense a gumball
23-
assertEquals(initialCount - 1, testGumBallMachine.getGumBallCount());
21+
int initialCount = testGumBallMachine.dispenseGumBallCount();
22+
testGumBallMachine.dispenseGumBall(0.25); // Dispense a gumball
23+
assertEquals(initialCount - 1, testGumBallMachine.dispenseGumBallCount());
2424
}
2525

2626
@Test
@@ -41,22 +41,16 @@ void testSetRandomColor() {
4141
previousColor, newColor, "The color should have changed after multiple attempts");
4242
}
4343

44-
@Test
45-
void testGetGumBall_whenValidQuarter() throws invalidCoinInsertedException {
46-
int previousCount = testGumBallMachine.getGumBallCount();
47-
testGumBallMachine.getGumBall(0.25);
48-
assertEquals(previousCount - 1, testGumBallMachine.getGumBallCount());
49-
}
50-
44+
5145
@Test
5246
void testGetGumBall_whenMachineIsEmpty() throws invalidCoinInsertedException {
5347
for (int i = 0; i < 10; i++) {
54-
testGumBallMachine.getGumBall(0.25); // Dispense all gumballs
48+
testGumBallMachine.dispenseGumBall(0.25); // Dispense all gumballs
5549
}
5650
assertThrows(
5751
invalidCoinInsertedException.class,
5852
() -> {
59-
testGumBallMachine.getGumBall(0.25); // Try to dispense from an empty machine
53+
testGumBallMachine.dispenseGumBall(0.25); // Try to dispense from an empty machine
6054
});
6155
}
6256

@@ -65,7 +59,7 @@ void testGetGumBall_InvalidCoin() {
6559
assertThrows(
6660
invalidCoinInsertedException.class,
6761
() -> {
68-
testGumBallMachine.getGumBall(0.01); // Try to insert an invalid coin
62+
testGumBallMachine.dispenseGumBall(0.01); // Try to insert an invalid coin
6963
});
7064
}
7165

lesson_22/angie's_template/hero.jpg

329 KB
Loading

lesson_22/angie's_template/index.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<html>
2+
<head>
3+
<title>Homepage</title>
4+
<meta name="viewport" content="width=device-width, initial-scale=1" />
5+
<link rel="stylesheet" id="redux-google-fonts-salient_redux-css" href="https://fonts.googleapis.com/css?family=Poppins%3A600%2C400%7CMontserrat%3A800%2C900%2C700&amp;ver=1597678827" type="text/css" media="all">
6+
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Poppins%3A600%2C400%7CMontserrat%3A800%2C900%2C700&#038;ver=1597678827' type='text/css' media='all' />
7+
<link rel="stylesheet" type="text/css" href="style.css">
8+
</head>
9+
<body>
10+
<header class="header">
11+
<div class="header-logo">
12+
<a href="index.html">
13+
<img src="logo.png" alt="Code Differently Logo" />
14+
</a>
15+
</div>
16+
<ul class="header-top-menu">
17+
<li><a href="#">Home</a></li>
18+
<li><a href="#">About</a></li>
19+
<li><a href="#">Contact</a></li>
20+
</ul>
21+
<div class="header-cta">
22+
<a class="sign-up-button" href="#">Sign Up</a>
23+
</div>
24+
</header>
25+
<div class="main">
26+
<div class="content">
27+
<article>
28+
<section class="hero-section">
29+
<div class="hero-overlay"></div>
30+
<div class="hero-content">
31+
<h2 class="hero-title">Together we can move the needle of <em class="highlight">diversity in tech.</em></h2>
32+
<div class="hero-text"><span>Code Differently</span> provides hands on training and education through coding classes that gives participants the technical and cognitive skills they need to excel in technology-driven workplaces.</div>
33+
</div>
34+
</section>
35+
<section class="programs-section">
36+
<h2>Our <em class="highlight">Programs</em></h2>
37+
<ul class="programs">
38+
<li class="program">
39+
<h3>1000 Kids Coding</h3>
40+
<p>The Code Differently 1000 Kids Coding program was created to expose New Castle County students to computing and programming. The 1000 Kids Coding courses are designed for all experience levels, no experience required.</p>
41+
</li>
42+
<li class="program">
43+
<h3>Return Ready</h3>
44+
<p>The Code Differently Workforce Training Initiatives were created to help individuals underrepresented in tech reinvent their skills to align with the changing workforce market. If you are ready to start your tech journey, join our talent community today.</p>
45+
</li>
46+
<li class="program">
47+
<h3>Pipeline DevShops</h3>
48+
<p>Pipeline DevShop is a youth work-based learning program. Youth participants experience working in a real software development environment while sharpening their technology and soft skills.</p>
49+
</li>
50+
<li class="program">
51+
<h3>Platform Programs</h3>
52+
<p>Platform programs are designed for high school graduates, college students, career changers, or professionals looking to develop the technology job readiness skills for today’s workforce.</p>
53+
</li>
54+
</ul>
55+
</section>
56+
</article>
57+
</div>
58+
</div>
59+
<footer class="footer">
60+
&copy; 2024 Code Differently
61+
</footer>
62+
</body>
63+
</html>

lesson_22/angie's_template/logo.png

29.2 KB
Loading

lesson_22/angie's_template/style.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+

0 commit comments

Comments
 (0)