-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHandleTest.java
More file actions
32 lines (30 loc) · 781 Bytes
/
HandleTest.java
File metadata and controls
32 lines (30 loc) · 781 Bytes
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
/**
* Tests the Handle class.
*
* @author karl88
* @author sfbahr
* @version Sep 17, 2014
*/
public class HandleTest extends student.TestCase
{
/**
* Tests the get method for handles.
*/
public void testGet()
{
Handle testHandle = new Handle(2);
assertEquals(2, testHandle.get());
}
/**
* Tests the compareTo method for Handle the class.
*/
public void testCompareTo()
{
Handle testHandle = new Handle(20);
Handle testHandleLarge = new Handle(200);
Handle testHandleSmall = new Handle(2);
assertEquals(0, testHandle.compareTo(testHandle));
assertEquals(-1, testHandle.compareTo(testHandleLarge));
assertEquals(1, testHandle.compareTo(testHandleSmall));
}
}