0
    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


Mobile accelerometers and gyroscopes check feature

I'm looking for a proper way to check if accelerometers and gyroscopes is available on mobile device ( mostly android & iphone ) in javascript.

Maybe by trying to figure out if the function called return something ?

4

1 に答える 1