代码拉取完成,页面将自动刷新
package test2;
import junit.framework.TestCase;
import org.junit.Test;
import test1.Complex;
public class ComplexTest extends TestCase {
test1.Complex a=new test1.Complex(0,3);
test1.Complex b=new test1.Complex(-1,-1);
test1.Complex c=new Complex(-1,-1);
@Test
public void testComplexAdd()throws Exception{
assertEquals("-1.0+2.0i",a.ComplexAdd(b).toString());
}
@Test
public void testComplexSub()throws Exception{
assertEquals("1.0+4.0i",a.ComplexSub(b).toString());
}
@Test
public void testComplexMulti()throws Exception{
assertEquals("3.0-3.0i",a.ComplexMulti(b).toString());
}
@Test
public void testComplexDiv()throws Exception{
assertEquals("-1.5-1.5i",a.ComplexDiv(b).toString());
}
@Test
public void testequals()throws Exception{
assertEquals(true,b.equals(c));
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。