There is a unit test required for a specific function[ExecuteSelectQuery] which happens to be as such:
internal abstract class DataRequestProcessor
{
protected DataView ExecuteSelectQuery(SqlDataSource dataSource)
{
//do some stuff
// need to mock this function
}
}
internal class AccountDataRequestProcessor : DataRequestProcessor
{
public InfoClass GetSomeDetail(ApiRequest<object> apiRequest)
{
....
ExecuteSelectQuery(dataSource);
.....
}
}
I thought of going with Interface but DataRequestProcessor simply says to change protection level. Same with if I try to inherit AccountDataRequestProcessor in test class "inconsistent accessibility base class is less accessible than derived class" . Is there a way to Mock the function[ExecuteSelectQuery] when it is called from unit test of class[GetSomeDetail] ? I am using xunit, with 4.5.2 .net framework , c# 7.3