We have the object
public class MyObject{
protected MyObject(){}
public string Property1 {get;private set;}
public string Property2 {get;private set;}
public string Property3 {get;private set;}
public string Property4 {get;private set;}
public string Property5 {get;private set;}
public string Property6 {get;private set;}
public string Property7 {get;private set;}
public string Property8 {get;private set;}
public string Property9 {get;private set;}
public string Property10 {get;private set;}
}
In our production code we populate this object through automapper. It can access the properties and set them correctly.
Now when we want to test this class in a future pipeline it is not possible to populate the properties with dummy values (to be tested against).
There are a few options available.
Custom constructors to accept the parameters required for the tests and set the properties, currently 3 constructors are required. This is not clean since the constructors do not serve any business functionality.
Make the properties virtual so the class can be stubbed. But marking the properties virtual does not provide any business value and pollute my class.
Add an object builder to the class to internally construct the object. Again no added business value. Perhaps a bit cleaner but still a lot of non relevant code in the domain objects.
Any suggestions, advice or alternative options here?