package com.test;
public class Calculation {
public static int add(int n1, int n2)
{
return n1 + n2;
}
public static int sub(int n1, int n2)
{
return n1 * n2;
}
}
は、上記の私のJUnitテストクラス私のクラスと以下 されているJUnitの誤差は
package com.test;
import static org.junit.Assert.*;
import org.junit.Test;
public class CalculationTest extends Calculation
{
CalculationTest test = new CalculationTest();
@Test
public void testadd()
{
assertEquals(9,Calculation.add(1,8));
}
public void testsub()
{
assertEquals(12,Calculation.sub(15,3));
}
}
こんにちはすべてのヘルプは、それが間違っているので、私は現在、私のサブテストでエラーを取得しようとしているいただければ幸いです私のクラスでは、しかし、私が現在取得しているエラーは私のjunitのLine 9にあります。なぜそれがエラーを引き起こすのか理解できないのです。
CalculationTest test = new CalculationTest();
はい、あなたは正しいと私にそれを説明していただきありがとう –
あなたを大歓迎!答えがあなたに役立ったことを確認していただきありがとうございます。この回答があなたの質問に答えると有用である場合は、サイト規約に従って、私が提供した答えをアップアップして受け入れることができますか?ありがとう! –
お受け取りいただきありがとうございます! –