public class EmployeeDetails {
private String name;
private double monthlySalary;
private int age;
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the monthlySalary
*/
public double getMonthlySalary() {
return monthlySalary;
}
/**
* @param monthlySalary the monthlySalary to set
*/
public void setMonthlySalary(double monthlySalary) {
this.monthlySalary = monthlySalary;
}
/**
* @return the age
*/
public int getAge() {
return age;
}
/**
* @param age the age to set
*/
public void setAge(int age) {
this.age = age;
}
}
如何将 EmployeeDetails.class 的列表传递给 JUnit 参数化类。
请帮助我编写参数方法
@Parameters
public static Collection employeeList()
{
List<EmployeeDetails> employees = new ArrayList<EmployeeDetails>;
return employees;
}
// 这会抛出类似“employeeList must return a Collection of arrays”的错误。
上面的 EmployeeDetails 类是一个例子。我需要将它用于类似的类,我将在其中发送类对象的列表。