最简单的测试问题。我把hamcrest jar包引入后写了:
package com.jazzy.test.test;import static org.junit.Assert.*;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.junit.Test;import com.jazzy.test.add.calculator;
import static org.hamcrest.Matchers.*;
public class calculatorTest { @Test
public void testAdd() {

calculator cal = new calculator();
double result = cal.add(3, 4);
assertThat(result,Matchers.is(9));
}
}
但是eclipse会报错,说the method assertThat(T, Matcher<T>) in the type Assert is not applicable for the arguments (double, Matcher<capture#1-of ? super Integer>)这是为什么呀~貌似别人就没这问题,有点郁闷啊。谢谢大家帮助