Skip to content

Commit e041b8a

Browse files
feat: changed ArrayList to List, added BeforeEach
1 parent 0005627 commit e041b8a

File tree

2 files changed

+8
-2
lines changed
  • lesson_16/objects/objects_app/src

2 files changed

+8
-2
lines changed

lesson_16/objects/objects_app/src/main/java/com/codedifferently/lesson16/xaviercruz/Person.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class Person {
1212
private Color eyeColor;
1313
private final int max_traits = 10;
1414

15-
public Person(String name, int age, Position position, ArrayList<String> traits, Color eyeColor) {
15+
public Person(String name, int age, Position position, List<String> traits, Color eyeColor) {
1616
this.name = name;
1717
this.age = age;
1818
this.position = position;

lesson_16/objects/objects_app/src/test/java/com/codedifferently/lesson16/xaviercruz/PersonTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@
55

66
import java.util.ArrayList;
77
import java.util.Arrays;
8+
9+
import org.junit.jupiter.api.BeforeEach;
810
import org.junit.jupiter.api.Test;
911

1012
public class PersonTest {
11-
Person person =
13+
Person person;
14+
@BeforeEach
15+
public void setUp(){
16+
person =
1217
new Person(
1318
"That one guy right there",
1419
25,
1520
Position.ARSONIST,
1621
new ArrayList<>(Arrays.asList("Tall", "Insane", "Funny", "something else here idk")),
1722
Color.RED);
23+
}
1824

1925
@Test
2026
public void testGetName() {

0 commit comments

Comments
 (0)