Question
Hi, I am pretty confused about how to write the test case for this class: /** * * This class uses a singleton pattern to
Hi, I am pretty confused about how to write the test case for this class:
/** * * This class uses a singleton pattern to mock a service instead of using dependency injection * * In addition, it stores data in memory only using Lists * */ public class DoctorService { private static DoctorService reference = new DoctorService(); private static List
}
I want to test all the methods in a test class TestDoctorService (not altering the DoctorService class in any way) and I want to test if a doctor with the same id is entered if it will be rejected since doctors can have the same name but not the same id which is unique. Can you just help with an example of your own?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started