forked from Zipcoder/BlueJ.SumOfInput
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SumOfInputTest.java
57 lines (46 loc) · 1.19 KB
/
SumOfInputTest.java
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
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* The test class SumOfInputTest.
*
* @author (your name)
* @version (a version number or a date)
*/
public class SumOfInputTest
{
/**
* Default constructor for test class SumOfInputTest
*/
//Bonus Question! How is this constructor used when none is defined
//in the class?
public SumOfInputTest()
{
}
@Before
public void setUp()
{
}
@After
public void tearDown()
{
}
@Test
public void test1(){
SumOfInput testSum = new SumOfInput();
assertEquals(Integer.valueOf(3), testSum.oneToNumber(2));
}
@Test
public void test2(){
SumOfInput testSum = new SumOfInput();
assertEquals(Integer.valueOf(95), testSum.oneToNumber(94));
assertEquals(Integer.valueOf(19), testSum.oneToNumber(18));
}
@Test
public void test3(){
SumOfInput testSum = new SumOfInput();
assertNotEquals(Integer.valueOf(9000), testSum.oneToNumber(42));
assertNotEquals(Integer.valueOf(99999999), testSum.oneToNumber(2425804));
}
}