測試層,判斷部分程式碼是否正確
阿新 • • 發佈:2018-12-20
package com.wh.test; import org.junit.Test; import com.wh.entity.User; import com.wh.servie.LoginService; import com.wh.servie.LoginServiceImpl; public class TestLoginService { @Test public void testLogin() { LoginService loginService=new LoginServiceImpl(); User user=new User("wang","1234", null, null, 0, null, null); Boolean bool=loginService.login(user); System.out.println(bool); } }
package com.wh.test; import java.util.Date; import org.junit.Test; import com.wh.entity.User; import com.wh.servie.RegisterServie; import com.wh.servie.RegisterServieIml; public class TestRegisterService { @SuppressWarnings("rawtypes") @Test public void testRegister() { System.out.println("我是測試輸出"); RegisterServie rs = new RegisterServieIml(); User user = new User( "aa", "adfd", "sf", "男", 23, "武漢", new Date()); Enum status = rs.register(user); System.out.println(status); } }