Create basic player #2

Merged
erns6604 merged 3 commits from player into main 2025-10-14 10:30:57 +02:00
2 changed files with 11 additions and 3 deletions
Showing only changes of commit 4e756e42dc - Show all commits

View File

@@ -1,3 +1,11 @@
public class Player {
private final String name;
public Player(String name) {
this.name = name;
}
public String getName() {
return name;
}
}

View File

@@ -4,9 +4,9 @@ import static org.junit.jupiter.api.Assertions.*;
class PlayerTest {
@Test
public void instantiates() {
var p = new Player();
assertNotNull(p);
public void instantiatesName() {
var p = new Player("abcd");
assertEquals("abcd", p.getName());
}
}