-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCompanyProfileTest.java
82 lines (64 loc) · 3.04 KB
/
CompanyProfileTest.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
78
79
80
81
82
import static org.junit.jupiter.api.Assertions.*;
import org.junit.After;
import org.junit.Before;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.jupiter.api.Test;
public class CompanyProfileTest {
@BeforeClass
public static void oneTimeSetup() {
}
@AfterClass
public static void oneTimeTearDown() {
}
@Before
public static void setUp() {
}
@After
public static void tearDown() {
}
@Test
public void testAddReviewValidReview() {
CompanyProfile c1 = new CompanyProfile("Global Enterprise", "112 Greene St", "Leading company in providing techonology in energy field");
Review r1 = new Review("Sarah", "Zachary", 3.9, "Great Company");
c1.addReview(r1);
assertEquals("Great Company",c1.getReviews().get(0).getMessage());
}
@Test
public void testAddReviewCompanyNull() {
CompanyProfile c2 = new CompanyProfile("Global Enterprise", "112 Greene St", "Leading company in providing techonology in energy field");
c2.addReview(null);
assertEquals(0, c2.getReviews().size());
}
@Test
public void testAddListingvalid() {
CompanyProfile c2 = new CompanyProfile("Global Enterprise", "112 Greene St", "Leading company in providing techonology in energy field");
c2.addListing(new JobListing("Software Developer"," Inter will get oppurtunity to deal with real softwares","South Carolina",true, 20.00, "Global Enterprise"));
assertEquals("Software Developer", c2.getListings().get(0).getTitle());
}
@Test
public void testAddListingNull() {
CompanyProfile c2 = new CompanyProfile("Global Enterprise", "112 Greene St", "Leading company in providing techonology in energy field");
c2.addListing(null);
assertNotEquals(1, c2.getListings().size());
}
@Test
public void testRemoveListingvalid() {
CompanyProfile c2 = new CompanyProfile("Global Enterprise", "112 Greene St", "Leading company in providing techonology in energy field");
JobListing j1 = new JobListing("Software Developer"," Inter will get oppurtunity to deal with real softwares","South Carolina",true, 20.00, "Global Enterprise");
c2.addListing(j1);
c2.removeListing(j1);
assertEquals(0, c2.getListings().size());
}
@Test
public void testRemoveWrongComapaniesListing() {
CompanyProfile c2 = new CompanyProfile("Global Enterprise", "112 Greene St", "Leading company in providing techonology in energy field");
JobListing j1 = new JobListing("Software Developer"," Inter will get oppurtunity to deal with real softwares","South Carolina",true, 20.00, "Global Enterprise");
CompanyProfile c3 = new CompanyProfile("Dose", "123 Assembly St.", "This is company");
JobListing j2 = new JobListing("Data Science", "Data Science intern listing","Utah",true,19.0,"Dose");
c2.addListing(j1);
c3.addListing(j2);
c3.removeListing(j1);
assertEquals(1, c3.getListings().size());
}
}