
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());
}
}
}