I've run into a problem. I have created a solution that uses IoC. However, I have a fatal flaw - a primary DTO that I use (Data Transfer Object - so, a class that passes through the layers) contains, for example, a Person with Name, Surname, DateOfBirth, StatusId ... and a List of valid Statuses.
The statuses are populated when the Person class is created, and data comes from a reference data repository... this repository is a singleton and gets data from a cache (one it's got data from the database initially).
So,
Name string {get; set;}
Surname string {get; set;}
StatusId int {get; set;}
Statuses List<ReferenceItem> {get; set;} = ReferenceData.GetData(DataType.ClientStatus);
In my unit test, I end up with a dependency on the ReferenceData class, which is a singleton. Is there a way to inject a mock ReferenceData class somehow? Or is my design flawed, and I need to redesign my Person class?