-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHalfDollarTest.java
More file actions
73 lines (56 loc) · 1.72 KB
/
HalfDollarTest.java
File metadata and controls
73 lines (56 loc) · 1.72 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
import org.junit.Assert;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
/**
* HalfDollarTest - a JUnit test for HalfDollar.java.
* @author Lisa Miller
* @since 1/24/22
*/
public class HalfDollarTest {
/** Fixture initialization (common initialization
* for all tests). **/
@Before public void setUp() {
}
/**
* HalfDollar getNameTest.
* Checks constructor and getName method
*/
@Test public void getNameTest() {
HalfDollar p = new HalfDollar();
Assert.assertEquals("GetName returns incorrect name.", "Half Dollar",
p.getName());
}
/**
* HalfDollar getValue test.
* Checks constructor and getValue method
*/
@Test public void getValueTest() {
HalfDollar p = new HalfDollar();
Assert.assertEquals("getValue returns incorrect HalfDollar value", .50, p.getValue(), .001);
}
/**
* HalfDollar getColor test.
* Checks constructor and getColor method
*/
@Test public void getColorTest() {
HalfDollar p = new HalfDollar();
Assert.assertEquals("getColor returns incorrect HalfDollar color", p.getColor(), "Silver");
}
/**
* HalfDollar getFront test.
* Checks constructor and getFront method
*/
@Test public void getFrontTest() {
HalfDollar p = new HalfDollar();
Assert.assertEquals("getFront returns incorrect HalfDollar front", p.getFront(), "John F. Kennedy");
}
/**
* HalfDollar getBack test.
* Checks constructor and getFront method
*/
@Test public void getBackTest() {
HalfDollar p = new HalfDollar();
Assert.assertEquals("getBack returns incorrect HalfDollar back", p.getBack(), "Presidential Coat of Arms");
}
}