以下のコードは2つのリストを比較しています。 私のステップでは、if文を使用してdestinationList
が空であるかどうかを確認します。そうであれば、テストが正しく、キュウリのステップを進める必要があります。キュウリ試験を失敗させることは可能ですか?
しかし、else文に達した場合、キュウリ試験に失敗する原因がありますか? `
if (destinationList.isEmpty()) {
System.out.println("This report is correct");
} else {
System.out.println("This report is incorrect.");
System.out.println("This list conatains the expected values of the report and their locations:");
System.out.println("expected = "+sourceList);
System.out.println("This list contains the actual value from this report and their locations:");
System.out.println("actual = "+destinationList);
}
if文に 'fail'を入れるのではなく、' Assert.assertTrue(destinationList.isEmpty()); ' – AndyN