-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuarterTest.java
More file actions
93 lines (72 loc) · 2.21 KB
/
QuarterTest.java
File metadata and controls
93 lines (72 loc) · 2.21 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import org.junit.Assert;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
/**
* QuarterTest - a JUnit test for Quarter.java.
* @author Lisa Miller
* @since 1/24/22
*/
public class QuarterTest {
/** Fixture initialization (common initialization
* for all tests). **/
@Before public void setUp() {
}
/**
* Quarter getNameTest.
* Checks constructor and getName method
*/
@Test public void getNameTest() {
Quarter p = new Quarter();
Assert.assertEquals("GetName returns incorrect name.", "Quarter",
p.getName());
}
/**
* Quarter getValue test.
* Checks constructor and getValue method
*/
@Test public void getValueTest() {
Quarter p = new Quarter();
Assert.assertEquals("getValue returns incorrect Quarter value", .25, p.getValue(), .001);
}
/**
* Quarter getColor test.
* Checks constructor and getColor method
*/
@Test public void getColorTest() {
Quarter p = new Quarter();
Assert.assertEquals("getColor returns incorrect Quarter color", p.getColor(), "Silver");
}
/**
* Quarter getFront test.
* Checks constructor and getFront method
*/
@Test public void getFrontTest() {
Quarter p = new Quarter();
Assert.assertEquals("getFront returns incorrect Quarter front", p.getFront(), "George Washington");
}
/**
* Quarter getBack test.
* Checks constructor and getFront method
*/
@Test public void getBackTest() {
Quarter p = new Quarter();
Assert.assertEquals("getBack returns incorrect Quarter back", p.getBack(), "Eagle");
}
/**
* Quarter getStateFront test.
* Checks constructor and getFront method
*/
@Test public void getStateFrontTest() {
Quarter p = new Quarter("Hawaii");
Assert.assertEquals("getFront returns incorrect Hawaii Quarter front", p.getFront(), "George Washington");
}
/**
* Quarter getBack test.
* Checks constructor and getFront method
*/
@Test public void getStateBackTest() {
Quarter p = new Quarter("Hawaii");
Assert.assertEquals("getBack returns incorrect Hawaii Quarter back", p.getBack(), "Kamehameha");
}
}