-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJobLisitingTest.java
78 lines (65 loc) · 2.38 KB
/
JobLisitingTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class JobLisitingTest {
private JobListing j1;
@BeforeEach
public void setup() {
j1 = new JobListing("Software Developer"," Inter will get oppurtunity to deal with real softwares","South Carolina",true, 20.00, "Global Enterprise");
}
@Test
public void addRequiredSkillValidTest() {
j1.addRequiredSkill("Java");
assertEquals("Java", j1.getRequiredSkills().get(0));
}
@Test
public void addRequiredSkillNullTest() {
j1.addRequiredSkill(null);
assertEquals(0, j1.getRequiredSkills().size());
}
@Test
public void addSameRequiredSkillTwiceTest() {
j1.addRequiredSkill("Java");
j1.addRequiredSkill("Java");
assertEquals(1, j1.getRequiredSkills().size());
}
@Test
public void removeRequiredSkillValidTest() {
j1.addRequiredSkill("Python");
j1.removeRequiredSkill("Python");
assertNotEquals(1, j1.getRequiredSkills().size());
}
@Test
public void removeRequiredSkillNullTest() {
j1.addRequiredSkill("C#");
j1.removeRequiredSkill(null);
assertEquals(1, j1.getRequiredSkills().size());
}
@Test
public void removeRequiredSkillOfWrongListingTest() {
JobListing j2 = new JobListing("Data Science"," Inter will get oppurtunity to deal with company's code","Chicago",true, 16.00, "Bose");
j1.addRequiredSkill("Hardworking");
j2.addRequiredSkill("Python");
j2.removeRequiredSkill("Hardworking");
assertEquals(1, j2.getRequiredSkills().size());
}
@Test
public void removeRequiredSkillCaseTest() {
j1.addRequiredSkill("Javascript");
j1.removeRequiredSkill("javaScript");
assertEquals(0, j1.getRequiredSkills().size());
}
@Test
public void applyValidTest() {
Student student = new Student("Lauren","Foltzo","[email protected]","lemonsqueezy", "Junior");
j1.apply(student);
assertEquals(1,j1.getApplicants().size());
}
@Test
public void applyTwiceTest() {
Student student = new Student("Lauren","Foltzo","[email protected]","lemonsqueezy", "Junior");
j1.apply(student);
j1.apply(student);
assertEquals(1, j1.getApplicants().size());
}
}