一、jar包
二、demo.java
注意import引入的不同方式方式
import static org.junit.Assert.*;
import org.hamcrest.*;
import org.junit.Test;
import com.ssj.util.Demo;
/*import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;
import org.junit.*;
import com.ssj.util.Demo;
*/
public class DemoTest
{
Demo demo=new Demo();
@Test
public void testAdd()
{
int sum=demo.add(1, 2);
//assertThat(sum,Matchers.is(3));
//assertThat(sum,is(3));
//assertThat(sum,Matchers.is(Matchers.not(4)));
//assertThat(sum,Matchers.allOf(Matchers.lessThan(5),Matchers.greaterThan(2)));
//assertThat(sum,Matchers.anyOf(Matchers.lessThan(2),Matchers.greaterThan(1)));
//assertThat(sum,Matchers.not(3));
//assertThat(sum,Matchers.instanceOf(Float.class));
}
}