Junit :测试

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
</dependencies>

写在测试类里:

import static org.junit.Assert.*;//导入Assert类所有的静态方法

public class TriangleTest{
    @Test
    public void test(){
        assertEquals(flase,new Triangle().judgEdges(1,2,3));
    }
}

asserEquals(期待的结果,测试用例)

posted on 2023-10-09 22:10  初晓臻  阅读(6)  评论(0编辑  收藏  举报