3 Star 0 Fork 0

CS-IMIS-23/20172329wwb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MyComplexTest.java 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
package exp;
import org.junit.Test;
import static org.junit.Assert.*;
public class MyComplexTest {
static MyComplex com1 = new MyComplex(1, 1);
static MyComplex com2 = new MyComplex(1, 1);
static MyComplex com3 = new MyComplex(2, 2);
static MyComplex com4 = new MyComplex(0 ,0);
static MyComplex com5 = new MyComplex(1, 0);
static MyComplex com6 = new MyComplex(0, 2);
@Test
public void equals() throws Exception{
assertEquals(com1.equals(com2), true);
}
@Test
public void complexAdd() throws Exception{
assertEquals(com1.ComplexAdd(com2).toString(), com3.toString());
}
@Test
public void complexSub() throws Exception{
assertEquals(com1.ComplexSub(com2).toString(), com4.toString());
}
@Test
public void complexMulti() throws Exception{
assertEquals(com1.ComplexMulti(com2).toString(), com6.toString());
}
@Test
public void complexDiv() throws Exception{
assertEquals(com1.ComplexDiv(com2).toString(), com5.toString());
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/CS-IMIS-23/20172327wwb.git
git@gitee.com:CS-IMIS-23/20172327wwb.git
CS-IMIS-23
20172327wwb
20172329wwb
master

搜索帮助