예제 #1
0
        public HttpResponseMessage Delete(int id)
        {
            var successAPIResult = new SuccessAPIResult()
            {
                Usage = "HttpDelete:~/api/Customers/{id} or {args} can be on querystring, {args?} are optional"
            };

            successAPIResult.Successful = CustomerBusinessLayer.DeleteCustomer(id);

            if (!successAPIResult.Successful)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound, successAPIResult));
            }

            return(Request.CreateResponse(HttpStatusCode.OK, successAPIResult));
        }
예제 #2
0
 public void WillCallDBLayerOnceWhenDelete()
 {
     CustomerBusinessLayer.DeleteCustomer(1);
     mockDBLayer.Verify(m => m.DeleteEntityByQuery <Customer>(It.IsAny <Query>()), Times.Once);
 }