-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDimeTest.java
More file actions
73 lines (56 loc) · 1.58 KB
/
DimeTest.java
File metadata and controls
73 lines (56 loc) · 1.58 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;
/**
* DimeTest - a JUnit test for Dime.java.
* @author Lisa Miller
* @since 1/24/22
*/
public class DimeTest {
/** Fixture initialization (common initialization
* for all tests). **/
@Before public void setUp() {
}
/**
* Dime getNameTest.
* Checks constructor and getName method
*/
@Test public void getNameTest() {
Dime p = new Dime();
Assert.assertEquals("GetName returns incorrect name.", "Dime",
p.getName());
}
/**
* Dime getValue test.
* Checks constructor and getValue method
*/
@Test public void getValueTest() {
Dime p = new Dime();
Assert.assertEquals("getValue returns incorrect Dime value", .10, p.getValue(), .001);
}
/**
* Dime getColor test.
* Checks constructor and getColor method
*/
@Test public void getColorTest() {
Dime p = new Dime();
Assert.assertEquals("getColor returns incorrect Dime color", p.getColor(), "Silver");
}
/**
* Dime getFront test.
* Checks constructor and getFront method
*/
@Test public void getFrontTest() {
Dime p = new Dime();
Assert.assertEquals("getFront returns incorrect Dime front", p.getFront(), "Franklin D. Roosevelt");
}
/**
* Dime getBack test.
* Checks constructor and getFront method
*/
@Test public void getBackTest() {
Dime p = new Dime();
Assert.assertEquals("getBack returns incorrect Dime back", p.getBack(), "torch");
}
}