-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRyanModdesetteTest.java
More file actions
68 lines (49 loc) · 1.39 KB
/
RyanModdesetteTest.java
File metadata and controls
68 lines (49 loc) · 1.39 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
63
64
65
66
67
68
package src;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.*;
import java.util.Calendar;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import junit.framework.Assert;
class RyanModdesetteTest {
@BeforeEach
void setUp() throws Exception {
Member testSuccess = new Member("Ryan",777777777,"12984 S Hagan St.","Olathe","KS",66062);
String name = testSuccess.name;
}
@Test
void testSuccessMemberConstructor() {
Member testSuccess = new Member("Ryan",777777777,"12984 S Hagan St.","Olathe","KS",66062);
String name = testSuccess.name;
assertEquals(name,"Ryan");
//fail("Not yet implemented");
}
@Test
void testExceptionProviderConstructor(){
try {
Provider testRyan = new Provider("Ryan",888888888,"100 burch street","Olathe","Kansas",66062,30.0);
Provider testChad = new Provider("Chad",888888888,"100 burch street","Olathe","Kansas",66062,30.0);
if(testRyan.name !=testChad.name) {
throw new Exception();
}
}
catch(Exception e){
assertTrue(true);
}
}
@Test
void testSuccessisDay() {
Calendar calendarTest = Calendar.getInstance();
int hour = calendarTest.get(Calendar.HOUR_OF_DAY);
if(hour <9 || hour>16) {
if(Main.isDay() ==false) {
assertTrue(true);
}
}
else {
if(Main.isDay()==true) {
assertTrue(true);
}
}
}
}