用junit编写测试用例

时间:2019-06-24 19:25:42

标签: java junit junit4

为该SetScene方法使用Junit编写测试用例的正确方法是什么?

public static void SetScene(int index){
  root.getChildren().remove(liste.get(indexcurrent));
  root.getChildren().add(liste.get(index));
  indexcurrent=index;


    if (index == 3) {
        try {
            root.setCenter(liste.get(index));
        }
        catch (Exception InvocationTargetException){
            }
        }
    }

1 个答案:

答案 0 :(得分:0)

我可能会做类似的事情

  1. root和孩子们做准备
  2. 致电SetScene(x)
  3. 检查rootcurrentindex的必需值和状态。
相关问题