1. 程式人生 > >學生管理系統(測試)

學生管理系統(測試)

登陸的測試類。

package com.wh.test;

import org.junit.Test;

import com.wh.entity.Student;
import com.wh.service.LoginService;
import com.wh.service.LoginServiceImpl;


public class TestLoginService {
@Test
public void testLogin() {
	LoginService loginService=new LoginServiceImpl();
	Student student=new Student("無厘頭大師","234");
	Boolean bool=loginService.login(student);
	System.out.println(bool);
}
}

註冊的測試類。

package com.wh.test;


import org.junit.Test;

import com.wh.entity.Student;
import com.wh.service.RegisterServie;
import com.wh.service.RegisterServieIml;
import com.wh.utils.DateUtil;



public class TestRegisterService {
@SuppressWarnings("rawtypes")
/**
 * 測試登陸功能是否實現
 */
@Test
public void testRegister() {
	System.out.println("我是測試輸出");
	RegisterServie rs = new RegisterServieIml();
	Student student = new Student(6, "你老婆真", "232", "朱小濤", "男", 23, "黃岡", DateUtil.dateParse("2018-1-1", "yyyy-MM-dd"));
	Enum status = rs.register(student);
	System.out.println(status);
}
}