我有测试的类和FormTest
测试用例Form
public class Form {
public doSomething() {}
}
public class GreenForm extends Form {
@Override
public doSomething() {}
}
public class YellowForm extends Form {
}
public class FormTest {
Form form = new Form();
@Test
public void doSomethingTest() { getForm().doSomething() }
public Form getForm() { return form; }
}
扩展FormTest
是测试GreenForm
和覆盖方法的正确方法吗?前任:
public class GreenFormTest extends FormTest {
Form form = new GreenForm();
@Override
public Form getForm() { return form; }
}