-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBasicAssertionTest.java
More file actions
40 lines (31 loc) · 1.03 KB
/
BasicAssertionTest.java
File metadata and controls
40 lines (31 loc) · 1.03 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
package io.github.walterinsh.basic;
import io.github.walterinsh.Method;
import org.testng.Assert;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
/**
* Some basic assertion examples.
*
* Assert throws an exception when your code falls. Then testing framework reports
* them to you. It's easier and fully automatically!
*
* Created by Walter on 11/4/15.
*/
public class BasicAssertionTest {
@Test
public void exampleOne() throws Exception {
Assert.assertNull(Method.returnsNull());
Assert.assertTrue(Method.returnsTrue());
Assert.assertFalse(!Method.returnsTrue());
Assert.assertEquals(Method.returnsOne(), 1);
Assert.assertNotEquals(Method.returnsOne(), 2);
}
@Test
public void useStaticImport() throws Exception {
assertNull(Method.returnsNull());
assertTrue(Method.returnsTrue());
assertFalse(!Method.returnsTrue());
assertEquals(Method.returnsOne(), 1);
assertNotEquals(Method.returnsOne(), 2);
}
}