forked from fenniless/BlueJ.TooLargeTooSmall
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTooLargeTooSmallTest.java
More file actions
43 lines (32 loc) · 918 Bytes
/
TooLargeTooSmallTest.java
File metadata and controls
43 lines (32 loc) · 918 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
32
33
34
35
36
37
38
39
40
41
42
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class TooLargeTooSmallTest
{
@Test
public void TestRun1()
{
// given
TooLargeTooSmall tooLarge1 = new TooLargeTooSmall(5);
// when
//then
assertEquals(Integer.valueOf(0), tooLarge1.guess(5));
}
@Test
public void TestRun2()
{
//given
TooLargeTooSmall tooLarge1 = new TooLargeTooSmall(6);
//when
assertEquals(Integer.valueOf(-1), tooLarge1.guess(4));
}
@Test
public void TestRun3()
{
TooLargeTooSmall tooLarge1 = new TooLargeTooSmall(2);
assertEquals(Integer.valueOf(-1), tooLarge1.guess(1));
assertEquals(Integer.valueOf(0), tooLarge1.guess(2));
assertEquals(Integer.valueOf(1), tooLarge1.guess(3));
}
}