-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEleriFloydJunit.java
More file actions
62 lines (51 loc) · 1.44 KB
/
EleriFloydJunit.java
File metadata and controls
62 lines (51 loc) · 1.44 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
62
package src;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
class EleriFloydJunit {
@BeforeEach
void setUp() throws Exception {
}
@Test
void testFindMemNotExist() {
HashMapInitialize.main();
int testMemNum = 1234567899;
Member testMem = OperatorMenu.findMem(testMemNum);
assertEquals(null, testMem);
}
@Test
void testFindMemExists() {
Member goalMem = new Member("John",123456789,"986 2nd Street","Coolville","KS",65063);
HashMapInitialize.main();
Member testMem = OperatorMenu.findMem(123456789);
assertEquals(goalMem.name, testMem.name);
}
@Test
public void testSearchProviderForFailure() {
try {
Provider testProv = ProviderFiles.searchProvider(999999999);
if (null != testProv) {
throw new Exception();
}
} catch (Exception e){
assertTrue(true);
}
}
@Test
public void testSearchProviderForSuccess() {
Provider goalProv = new Provider("Dr. Stevens", 999999999, "321 44th Street", "Hoover", "AL", 23542, 0);
HashMapInitialize.main();
Provider testProv = ProviderFiles.searchProvider(999999999);
assertEquals(goalProv.name, testProv.name);
}
@Test
void testValidEmailTrue() {
String testEmail = "eleri.floyd@gmail.com";
assertEquals(true, Main.isValidEmail(testEmail));
}
@Test
void testValidEmailFalse() {
String testEmail = "eleri.floydgmail.com";
assertEquals(false, Main.isValidEmail(testEmail));
}
}