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

0

泛型类的每个实例都是一个单独的 .NET 类型。Fakes API 要求您单独填充每个实例,并且目前不提供单个 API 来填充多种类型。

于 2013-06-17T15:41:12.763 回答