Java 练习(开发团队调度软件四)

NameListServiceTest.java

package com.klvchen.team.junit;

import org.junit.Test;

import com.klvchen.team.domain.Employee;
import com.klvchen.team.service.NameListService;
import com.klvchen.team.service.TeamException;

public class NameListServiceTest {
	
	@Test
	public void testGetAllEmployees() {
		NameListService service = new NameListService();
		Employee[] employees = service.getAllEmployees();
		for(int i = 0; i< employees.length; i++) {
			System.out.println(employees[i]);
		}
		
	}
	
	@Test
	public void testGetEmployee() {
		NameListService service = new NameListService();
		int id = 1;
		id = 15;
		try {
			Employee employee = service.getEmployee(id);
			System.out.println(employee);
		}catch(TeamException e) {
			System.out.println(e.getMessage());
		}
	}

}
posted @ 2021-04-01 15:09  klvchen  阅读(3)  评论(0)    收藏  举报