相关疑难解决方法(0)

未找到类:IntelliJ中的空测试套件

我刚刚在我的大学开始计算机科学课程,而且我在使用IntelliJ时遇到了一些问题.当我尝试运行单元测试时,我收到了消息

Process finished with exit code 1
Class not found: "edu.macalester.comp124.hw0.AreaTest"Empty test suite.
Run Code Online (Sandbox Code Playgroud)

我还在屏幕左侧看到一条标题为"未找到测试"的消息.我的测试代码在这里:

package edu.macalester.comp124.hw0;


import org.junit.Test;
import static org.junit.Assert.*;

public class AreaTest {

    @Test
    public void testSquare() {
    assertEquals(Area.getSquareArea(3.0), 9.0, 0.001);
    }

    @Test
    public void testCircle() {
    assertEquals(Area.getCircleArea(3.0), 28.2743, 0.001);
    }
}
Run Code Online (Sandbox Code Playgroud)

我的项目代码在这里:

package edu.macalester.comp124.hw0;

import java.lang.Math;
public class Area {

/**
 * Calculates the area of a square.
 * @param sideLength The length of the side of a square
 * @return The area
 */
public static double …
Run Code Online (Sandbox Code Playgroud)

java junit unit-testing intellij-idea

172
推荐指数
15
解决办法
15万
查看次数

标签 统计

intellij-idea ×1

java ×1

junit ×1

unit-testing ×1