Skip to content

Commit f1d9734

Browse files
committed
feat: adds Employee.java test and getDetails Method
1 parent 36e2963 commit f1d9734

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

lesson_15/tdd/tdd_app/src/main/java/com/codedifferently/lesson15/Employee.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,8 @@ public boolean containsKey(Object id2) {
5050
// TODO Auto-generated method stub
5151
throw new UnsupportedOperationException("Unimplemented method 'containsKey'");
5252
}
53+
54+
public Employee getDetails(Employee employee) {
55+
return employee;
56+
}
5357
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.codedifferently.lesson15;
2+
3+
import static org.assertj.core.api.Assertions.*;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
public class EmployeeTest {
8+
private Employee employee;
9+
10+
@Test
11+
void testGetDetails() {
12+
// Arrange
13+
employee = new Employee(1, "Jet Li", "Specialist", 110.00);
14+
// Act
15+
Employee actualDetails = employee.getDetails(employee);
16+
// Assert
17+
assertThat(actualDetails).isEqualTo(employee);
18+
}
19+
}

0 commit comments

Comments
 (0)