Can a JUnit testmethod have a argument?

后端 未结 4 737
慢半拍i
慢半拍i 2020-12-09 08:57
import java.util.regex.Pattern;

public class TestUI {
    private static Pattern p = Pattern.compile(\"^[A-Za-z0-9()+-]+$\");

    public static void main(String[]          


        
4条回答
  •  無奈伤痛
    2020-12-09 09:43

    You should take a look at parameterized unit tests (introduced in JUnit 4).

    Daniel Mayer's blog has an example of this.

    Another, more simple example is on mkyong's webpage

提交回复
热议问题