嘿嘿,JAVA里第一次运行单元测试成功,立存
生活随笔
收集整理的这篇文章主要介绍了
嘿嘿,JAVA里第一次运行单元测试成功,立存
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
按书上写的单元测试。
居然一次过,爽!!!
package org.smart4j.chapter2.test;import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.smart4j.chapter2.model.Customer; import org.smart4j.chapter2.service.CustomerService; /*** Created by sahara on 2016/3/16.*/ public class CustomerServiceTest {private final CustomerService customerService;public CustomerServiceTest() {customerService = new CustomerService();}@Beforepublic void init() {// TODO }@Testpublic void getCutomerListTest() throws Exception {List<Customer> customerList = customerService.getCustomerList();Assert.assertEquals(2, customerList.size());} }总结
以上是生活随笔为你收集整理的嘿嘿,JAVA里第一次运行单元测试成功,立存的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: php excel文件导出之二 图像导出
- 下一篇: FZU 1061 矩阵连乘