Skip to content

Commit 87319d7

Browse files
authored
Merge pull request #52 from pgk1216/pgk
Setup JUnit 5
2 parents e6bdbe7 + 9ad633d commit 87319d7

File tree

6 files changed

+51
-0
lines changed

6 files changed

+51
-0
lines changed

.idea/encodings.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dinosaur-exploder.iml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<content url="file://$MODULE_DIR$">
77
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
88
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
910
<excludeFolder url="file://$MODULE_DIR$/target" />
1011
</content>
1112
<orderEntry type="inheritedJdk" />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.dinosaur.dinosaurexploder.model;
2+
3+
import static org.junit.jupiter.api.Assertions.*;
4+
5+
class GameEntityFactoryTest {
6+
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.dinosaur.dinosaurexploder.model;
2+
3+
import static org.junit.jupiter.api.Assertions.*;
4+
5+
class GreenDinoComponentTest {
6+
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.dinosaur.dinosaurexploder.model;
2+
3+
import static org.junit.jupiter.api.Assertions.*;
4+
5+
class PlayerComponentTest {
6+
7+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.dinosaur.dinosaurexploder.model;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import static org.junit.jupiter.api.Assertions.*;
6+
7+
class ScoreComponentTest {
8+
9+
@Test
10+
void checkGetSetScore() {
11+
var scoreComponent = new ScoreComponent();
12+
13+
scoreComponent.setScore(5);
14+
15+
assertEquals(5, scoreComponent.getScore());
16+
}
17+
18+
@Test
19+
void checkIncrementProperly() {
20+
var scoreComponent = new ScoreComponent();
21+
22+
scoreComponent.setScore(4);
23+
24+
scoreComponent.incrementScore(1);
25+
assertEquals(5, scoreComponent.getScore());
26+
}
27+
28+
}

0 commit comments

Comments
 (0)