Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi i need help implementing the proper code for a JUnit test within my code for

ID: 3905105 • Letter: H

Question

Hi i need help implementing the proper code for a JUnit test within my code for eclipse oxygen:

package medical.com.medicalApplication.model;

import static org.junit.Assert.*;

import org.junit.Test;

public class Employee {
private String name;
private String id;
private String password;

public Employee(String name, String id) {
  super();
  this.name = name;
  this.id = id;
  this.password = "Open";
}

public String getName() {
  return name;
}

public String getId() {
  return id;
}

public String getPassword() {
  return password;
}

}

Explanation / Answer

import static org.junit.Assert.*; import org.junit.Test; public class EmployeeTest { Employee employee = new Employee("Employee Name","Employee ID"); @Test public void TestGetName(){ assertEquals(employee.getName(),"Employee Name"); } @Test public void TestGetID(){ assertEquals(employee.getId(),"Employee ID"); } @Test public void TestGetPassword(){ assertEquals(employee.getPassword(),"Open"); } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote