import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
@RunWith(Parameterized.class)
public class TestWordDealUtilWithParam {
private String expected;
private String target;
@Parameters
public static Collection words(){
return Arrays.asList(new Object[][]{
{"employee_info", "employeeInfo"}, //測試一般的處理情況
{null, null}, //測試 null 時的處理情況
{"", ""}, //測試空字符串時的處理情況
{"employee_info", "EmployeeInfo"}, //測試當首字母大寫時的情況
{"employee_info_a", "employeeInfoA"}, //測試當尾字母為大寫時的情況
{"employee_a_info", "employeeAInfo"} //測試多個相連字母大寫時的情況
});
}
/**
* 參數化測試必須的構造函數
文章來源于領測軟件測試網 http://www.kjueaiud.com/