0% found this document useful (0 votes)
10 views2 pages

HTML

Uploaded by

samip rawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

HTML

Uploaded by

samip rawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

public class EmployeeDetails {

private String name ;


private double Monthlysalary ;
private int age ;

public String getName() {


return name;

}
public double getMonthlysalary() {
return Monthlysalary;
}
public int getage() {
return age;
}

public void setAge(int age) {


this.age = age;
}
public void setName(String name) {
this.name = name;
}
public void setMonthlysalary(double monthlysalary) {
Monthlysalary = monthlysalary;
}

public class EmpBunsinessLogic {


public double calculateYearlysalary (EmployeeDetails employeeDetails) {
double yearlySalary = 0;
yearlySalary = employeeDetails.getMonthlysalary();
return yearlySalary;
}
public double calculateAppraisal(EmployeeDetails employeedetails) {
double Appraisal = 0;
if (employeedetails.getMonthlysalary()<10000) {
Appraisal = 500;
}
else {Appraisal = 1000;
}
return Appraisal;
}
}
//import static org.junit.Assert.assertEquals;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class TestEmployeeDetails {


EmpBunsinessLogic empBusinessLogic = new EmpBunsinessLogic();
EmployeeDetails employee = new EmployeeDetails();
@Test
public void testClaculateAppraisal() {
employee.setName("samip");
employee.setAge(19);
employee.setMonthlysalary(1570);
double Appraisal = empBusinessLogic.calculateAppraisal(employee);
assertEquals(500,Appraisal,0.0);

You might also like