I have a class Report with properties like Title, Status, Type as shown below:
Public class Report
{
public string Title { get; set; }
public string Status { get; set; }
public string Type { get; set; }
}
All these properties are getting set from values coming from DB. After that, I am passing this object to another API. I am not using get in my own implementation. When I wrote a unit test case and run Code coverage analyzer in Visual Studio 2015, it says that get is not covered. So is it ok to write properties with the only setter in this scenario? Is it the correct way to do? Otherwise, how can I include get in code coverage?
I went through below links but not getting a proper answer as what to do in my case.
Why using only setter in property declaration? Do write-only properties have practical applications?