s********e 发帖数: 340 | 1 请教一个 Java TDD 测试的问题!
请问TDD测试,需要测试构造器方法吗?比如下面类的OrderManager是构造方法,对该
如何进行单元测试呢? 谢谢指教!
public class OrderManager {
private final OrderStore orderStore;
private final OrderWriter orderCreater;
public OrderManager(OrderStore orderStore, OrderCreater orderCreater) {
this.orderStore = orderStore;
this.orderCreater = orderCreater;
}
public void writeOrders() {
List allOrders = orderStore.getOrders();
if (allOrders.size() == 0) {
thr... 阅读全帖 |
|