public HttpResponseMessage Get(int page = 1, int pageSize = 2) { var customerPagedListAPIResult = new CustomerPagedListAPIResult { Page = page, PageSize = pageSize, Usage = "HttpGet:~/api/CustomerDetail/{page?}/{pageSize?} or {args} can be on querystring, {args?} are optional" }; customerPagedListAPIResult.CustomerList = CustomerBusinessLayer.GetCustomers(page, pageSize); if (customerPagedListAPIResult.CustomerList == null) { return(Request.CreateResponse(HttpStatusCode.NotFound, customerPagedListAPIResult)); } return(Request.CreateResponse(HttpStatusCode.OK, customerPagedListAPIResult)); }
public void WillCallDBLayerOnceWhenGetAll() { CustomerBusinessLayer.GetCustomers(1, 1); mockDBLayer.Verify(m => m.FindAllEnties <Customer>(It.IsAny <int>(), It.IsAny <int>()), Times.Once); }