1
1
package com .codedifferently .lesson15 ;
2
2
3
3
import static org .junit .jupiter .api .Assertions .assertEquals ;
4
+
4
5
import org .junit .jupiter .api .Test ;
5
6
6
7
class EmployeeTest {
@@ -15,97 +16,91 @@ public void getId() {
15
16
assertEquals (expectedId , actual );
16
17
}
17
18
18
-
19
- @ Test
19
+ @ Test
20
20
public void setId () {
21
21
int expectedId = 7 ;
22
22
23
23
Employee employee1 = new Employee (7 , null , null , 0 , null );
24
24
25
25
employee1 .setId (expectedId );
26
26
27
- assertEquals ( expectedId , employee1 .getId ());
27
+ assertEquals (expectedId , employee1 .getId ());
28
28
}
29
29
30
-
31
- @ Test
30
+ @ Test
32
31
public void getName () {
33
32
var expectedNameString = "Montez" ;
34
33
35
34
Employee employee1 = new Employee (0 , "Montez" , "" , 0 , null );
36
35
37
36
var actual = employee1 .getName ();
38
37
39
- assertEquals ( expectedNameString , actual );
38
+ assertEquals (expectedNameString , actual );
40
39
}
41
40
42
-
43
- @ Test
41
+ @ Test
44
42
public void setName () {
45
43
var expectedNameString = "Montez" ;
46
44
47
45
Employee employee1 = new Employee (0 , "Montez" , "" , 0 , null );
48
46
49
47
employee1 .setName (expectedNameString );
50
48
51
- assertEquals ( expectedNameString , employee1 .getName ());
49
+ assertEquals (expectedNameString , employee1 .getName ());
52
50
}
53
51
54
- @ Test
52
+ @ Test
55
53
public void getDepartment () {
56
54
var expectedString = "Tech" ;
57
55
58
- Employee employee1 = new Employee (0 , null , "Tech" , 0 , null );
56
+ Employee employee1 = new Employee (0 , null , "Tech" , 0 , null );
59
57
60
58
var actual = employee1 .getDepartment ();
61
59
62
- assertEquals ( expectedString , actual );
60
+ assertEquals (expectedString , actual );
63
61
}
64
62
65
- @ Test
63
+ @ Test
66
64
public void setDepartment () {
67
65
var expectedDepartment = "Sales" ;
68
66
69
67
Employee employee1 = new Employee (0 , null , "Tech" , 0 , null );
70
68
71
69
employee1 .setDepartment ("Sales" );
72
70
73
- assertEquals ( expectedDepartment , employee1 .getDepartment ());
71
+ assertEquals (expectedDepartment , employee1 .getDepartment ());
74
72
}
75
73
76
- @ Test
74
+ @ Test
77
75
public void getSalary () {
78
76
var expectedSalary = 50000 ;
79
77
80
- Employee employye2 = new Employee ( 0 , null , null , expectedSalary , null );
78
+ Employee employye2 = new Employee (0 , null , null , expectedSalary , null );
81
79
82
80
var actual = employye2 .getSalary ();
83
81
84
- assertEquals ( expectedSalary , actual );
82
+ assertEquals (expectedSalary , actual );
85
83
}
86
84
87
- @ Test
85
+ @ Test
88
86
public void setSalary () {
89
87
int expectedSalary = 4200 ;
90
88
91
89
Employee employee1 = new Employee (0 , null , null , expectedSalary , null );
92
90
93
91
employee1 .setSalary (expectedSalary );
94
92
95
- assertEquals ( expectedSalary , employee1 .getSalary ());
93
+ assertEquals (expectedSalary , employee1 .getSalary ());
96
94
}
97
95
98
96
@ Test
99
- public void setDetails () {
100
- var expectedDetailString = "Non Hipanic Black " ;
97
+ public void getDetails () {
98
+ var expectedString = "Detail " ;
101
99
102
- Employee employee = new Employee (0 , null , null , 0 , "Non Hispanic Black " );
100
+ Employee employee1 = new Employee (0 , null , null , 0 , "Detail " );
103
101
104
- var actual = employee .getDetails ();
102
+ var actual = employee1 .getDetails ();
105
103
106
- assertEquals (expectedDetailString , actual );
104
+ assertEquals (expectedString , actual );
107
105
}
108
106
}
109
-
110
-
111
-
0 commit comments