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

Write th a test class with two distinct test cases to test the findMatch s. foll

ID: 3729849 • Letter: W

Question

Write th a test class with two distinct test cases to test the findMatch s. following JobList class, which should return the Job (pointer to it which has the most matches for the given skills, nul/mullptr f none d jobs has any matches for the other tha using.) u meth od of for ce n JUnit or QTest, please indicate the name of the framework you are Applicant's skills. (If you are 1c++ version just the public interface part class JobList i public: Job * findMatch (vector applicantSkills); void addJob (Job job); class Job private: string title; vector skills; public: Job (string jobTitle, vector

Explanation / Answer

In Junit , we basically use statements like assertEquals, AssertNull, AssertTrue and assertNull etc to verify our output is as per expectations or not.

In this first test case, I have made an object of Job and Job list instantiated both of them. Then I have called the method findMatch passing the list of string that I have set in Job object. The findMatch returns an object of job that I have stored on job1. Then Both the results i.e. job1 and job is compared using assertEquals.

****************************************************************1******************************************************************

public class testJobList{

@Test

public void testFindMatch(){

Job job = new Job();

JobList jobList = new JobList();

job.title = "developer";

List<String> skills = new ArrayList<>();

skills.add("problem solving");

List<String> applicantSkills = new ArrayList<>();

skills.add("problem solving");

Job job1 = jobList.findMatchList(applicantSkills);

assert.Equals(job 1, job);

}

**********************************************************************************************************************************

In this second test case, I have made an object of Job and Job list instantiated both of them. Then I have called the method findMatch passing the list of string that I have set in Job object. The findMatch returns an object of job that must have the same title that the instantiated object of job has.

**********************************************2*********************************************************************************

@Test

public void testFindMatch(){

Job job = new Job();

JobList jobList = new JobList();

job.title = "developer";

List<String> skills = new ArrayList<>();

skills.add("problem solving");

List<String> applicantSkills = new ArrayList<>();

skills.add("problem solving");

Job job1 = jobList.findMatchList(applicantSkills);

assert.Equals(job1.title, job.title);

}

***********************************************************************************************************************************

In this third test case, I have made an object of Job and Job list instantiated both of them. Then I have called the method findMatch passing the list of string that I have set in Job object. The findMatch returns an object of job that must have the same list of skills as that the instantiated object of job has. So I verified this condition using assertTrue.

******************************************************3*************************************************************************

@Test

public void testFindMatch(){

Job job = new Job();

JobList jobList = new JobList();

job.title = "developer";

List<String> skills = new ArrayList<>();

skills.add("problem solving");

List<String> applicantSkills = new ArrayList<>();

skills.add("problem solving");

Job job1 = jobList.findMatchList(applicantSkills);

}

********************************************************************************************************************************

Hope this will help

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote