2 Star 0 Fork 0

CS-IMIS-23 / 20172311hai

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ComplexTest.java 891 Bytes
一键复制 编辑 原始数据 按行查看 历史
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));
}
}
Java
1
https://gitee.com/CS-IMIS-23/20172311hai.git
git@gitee.com:CS-IMIS-23/20172311hai.git
CS-IMIS-23
20172311hai
20172311hai
master

搜索帮助