Skip to content

Commit 21ccaa2

Browse files
committed
Update class name
1 parent bb5df0c commit 21ccaa2

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

src/main/java/com/language/programming/model/Spaceship.java renamed to src/main/java/com/language/programming/model/Starship.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.language.programming.model;
22

3-
public class Spaceship {
3+
public class Starship {
44

5-
private Spaceship() {
5+
private Starship() {
66
};
77

88
private String name;
@@ -12,9 +12,9 @@ private Spaceship() {
1212
private Integer crewNumber;
1313
private Float fuel;
1414

15-
private static Spaceship instance = new Spaceship();
15+
private static Starship instance = new Starship();
1616

17-
public static Spaceship getInstance() {
17+
public static Starship getInstance() {
1818
return instance;
1919
}
2020

src/test/java/com/language/programming/model/SpaceshipTest.java

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.language.programming.model;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import static org.junit.jupiter.api.Assertions.*;
6+
7+
public class StarshipTest {
8+
9+
@Test
10+
public void shouldReturnSpaceshipName() {
11+
12+
Starship.getInstance().setName("USS Enterprise");
13+
assertEquals("USS Enterprise", Starship.getInstance().getName());
14+
}
15+
16+
@Test
17+
public void shouldReturnSpaceshipCrewNumber() {
18+
19+
Starship.getInstance().setCrewNumber(20);
20+
assertEquals(20, Starship.getInstance().getCrewNumber());
21+
}
22+
}

0 commit comments

Comments
 (0)