-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSimpleTest.java
More file actions
49 lines (38 loc) · 889 Bytes
/
SimpleTest.java
File metadata and controls
49 lines (38 loc) · 889 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
43
44
45
46
47
48
49
//demo9
package com.nijjwal;
import static org.junit.Assert.assertEquals;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
//import org.junit.Ignore;
import org.junit.Test;
public class SimpleTest {
private static Simple simple;
@BeforeClass
public static void initSimple() {
simple = new Simple();
}
@Before
public void beforeEachTest() {
System.out.println("This method is executed before each Test");
}
@After
public void afterEachTest() {
System.out.println("This method is executed after each Test");
}
@Test
public void displayHiddenNumber() {
int x = simple.printNumber();
assertEquals(8, x);
}
@Test
public void addTwoNumbersTest() {
int x = simple.addTwoNumbers(2, 3);
assertEquals(5, x);
}
@Test
public void subtractTwoNumbersTest() {
int x = simple.subtractTwoNumbers(10, 7);
assertEquals(3, x);
}
}