繁体   English   中英

用junit写一个测试用例

[英]Write a Test case with junit

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

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. 和孩子一起准备root
  2. 调用SetScene(x)
  3. 检查rootcurrentindex是否需要值和状态。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM