-
Notifications
You must be signed in to change notification settings - Fork 0
/
casdetest.txt
83 lines (77 loc) · 3.46 KB
/
casdetest.txt
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
83
package com.example.servicesnovigrad;
import androidx.annotation.NonNull;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
@Test
public void testServiceConstructor() {
Service service = new Service("Jaune attend!", 23);
assertEquals("Jaune attend!", service.getServiceType());
assertEquals(23, service.getServicePrice());
}
@Test
public void testServiceAddOneRequiredInfo() {
Service service = new Service("Jaune attend!", 23);
service.addRequiredInfo("This information is necessary");
assertEquals("This information is necessary", service.getRequiredInformation().get(0));
}
@Test
public void testServiceAddTwoRequiredInfo() {
Service service = new Service("Jaune attend!", 23);
service.addRequiredInfo("This information is necessary");
service.addRequiredInfo("This information is even more necessary!");
assertEquals("This information is necessary", service.getRequiredInformation().get(0));
assertEquals("This information is even more necessary!", service.getRequiredInformation().get(1));
}
@Test
public void testServiceAddOneRequiredDocumentType() {
Service service = new Service("Jaune attend!", 23);
service.addRequiredDoc(DocumentType.PHOTO);
assertEquals(DocumentType.PHOTO, service.getRequiredDocument().get(0));
}
@Test
public void testServiceAddTwoRequiredDocumentType() {
Service service = new Service("Jaune attend!", 23);
service.addRequiredDoc(DocumentType.PHOTO);
service.addRequiredDoc(DocumentType.PREUVE_DE_DOMICILE);
assertEquals(DocumentType.PHOTO, service.getRequiredDocument().get(0));
assertEquals(DocumentType.PREUVE_DE_DOMICILE, service.getRequiredDocument().get(1));
}
@Test
public void testServiceAddThreeRequiredDocuments() {
Service service = new Service("Jaune attend!", 23);
service.addRequiredDoc(DocumentType.PHOTO);
service.addRequiredDoc(DocumentType.PREUVE_DE_DOMICILE);
service.addRequiredDoc(DocumentType.PREUVE_DE_STATUS);
assertEquals(DocumentType.PHOTO, service.getRequiredDocument().get(0));
assertEquals(DocumentType.PREUVE_DE_DOMICILE, service.getRequiredDocument().get(1));
assertEquals(DocumentType.PREUVE_DE_STATUS, service.getRequiredDocument().get(2));
}
@Test
public void testServiceAddTwoRemoveFirstRequiredDocumentType() {
Service service = new Service("Jaune attend!", 23);
service.addRequiredDoc(DocumentType.PHOTO);
service.addRequiredDoc(DocumentType.PREUVE_DE_DOMICILE);
service.removeRequiredDoc(DocumentType.PHOTO);
assertEquals(DocumentType.PREUVE_DE_DOMICILE, service.getRequiredDocument().get(0));
}
@Test //nouveau test
public void userConstructor() {
User user = new User("rony","12345678","[email protected]");
assertEquals("rony",user.getUsername());
assertEquals("12345678",user.getPassword());
}
}