Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I write a test case for a class that just calls in objects from another class? The class I am writing the test

How do I write a test case for a class that just calls in objects from another class?

The class I am writing the test case for calls the Patient and PatientHistory classes is:

package medical.com.medicalApplication.model; /** * * * This class represents a medical record model in the system * */ public class MedicalRecord {

private Patient patient; private PatientHistory history; public MedicalRecord(Patient patient) { super(); this.patient = patient; this.history = new PatientHistory(); }

public Patient getPatient() { return patient; }

public PatientHistory getHistory() { return history; } }

I have attempted to write it but what I had does not work so the method is empty:

public class TestMedicalRecord { private MedicalRecord medicalRecord; private Patient patient; @Before public void setUp() { this.medicalRecord = new MedicalRecord(patient); } @Test public void testGetPatient() { } If you could just make some suggestions or provide an explanation on how to do so I would appreciate it.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions