-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathAddressDeletionTest.java
More file actions
61 lines (42 loc) · 1.8 KB
/
Copy pathAddressDeletionTest.java
File metadata and controls
61 lines (42 loc) · 1.8 KB
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
package Model;
import com.lob.model.AddressDeletion;
import org.testng.Assert;
import org.testng.annotations.Test;
public class AddressDeletionTest {
private final AddressDeletion model = new AddressDeletion();
@Test(enabled=true)
public void testAddressDeletion() {
AddressDeletion addressDeletion = new AddressDeletion();
Boolean deleted = true;
model.setId("adr_fakeId");
model.setDeleted(deleted);
Assert.assertNotNull(addressDeletion);
Assert.assertNotNull(model.getId());
Assert.assertNotNull( model.getDeleted());
Assert.assertNotNull(model.getObject());
Assert.assertEquals(model.getId(), "adr_fakeId");
Assert.assertEquals(model.getDeleted(), deleted);
}
@Test(enabled=true)
public void idTest() {
AddressDeletion addressDeletion = new AddressDeletion();
Assert.assertNull(addressDeletion.getId());
}
@Test(enabled=true, expectedExceptions = {IllegalArgumentException.class}, expectedExceptionsMessageRegExp = "Invalid id provided")
public void idTestCatchesException() throws IllegalArgumentException {
AddressDeletion addressDeletion= new AddressDeletion();
addressDeletion.setId("Nope");
}
@Test(enabled=true)
public void deletedTest() {
AddressDeletion addressDeletion = new AddressDeletion();
Assert.assertNull(addressDeletion.getDeleted());
}
@Test(enabled=true)
public void _objectTest() {
AddressDeletion addressDeletion = new AddressDeletion();
AddressDeletion.ObjectEnum object = AddressDeletion.ObjectEnum.ADDRESS_DELETED;
Assert.assertNotNull(addressDeletion.getObject());
Assert.assertEquals(addressDeletion.getObject(), object);
}
}