List<Customer> customerList= new List<Customer>();
List<Employee> employeeList= new List<Employee>();
Fakes.ShimDataServiceRepository<object>.AllInstances.GetEntitiesExpressionOfFuncOfT0Boolean = (instance, filter) =>
{
if (filter.Body.ToString().Contains("sg.CustomerName"))
{
return customerList.AsQueryable();
}
else if (filter.Body.ToString().Contains("ib.EmployeeName"))
{
return employeeList.AsQueryable();
}
return null;
};
When my test method call a business layer method and business layer method call unitofwork.CustomerRespository.GetEntities(filter condition) the call goes to
this.GetEntityQuery(filter, orderBy, includeProperties, startPage, pageSize);
and it inturn calls the actual database call and error.
The call is not hitting the point in the fake
return customerList.AsQueryable();
When i use the specific class 'Customer' instead of object like
`Fakes.ShimDataServiceRepository<Customer>`
it is working fine. But i need a general fake method.
Please help