File tree Expand file tree Collapse file tree 3 files changed +26
-26
lines changed
main/java/com/language/programming/model
test/java/com/language/programming/model Expand file tree Collapse file tree 3 files changed +26
-26
lines changed Original file line number Diff line number Diff line change 11package 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
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments