Ejemplo n.º 1
0
        public HttpResponseMessage Put(int id, Agent agent)
        {
            var successAPIResult = new SuccessAPIResult()
            {
                Usage = "HttpPut:~/api/Agent/{id} with Agent json in body"
            };

            successAPIResult.Successful = AgentBusinessLayer.UpdateAgent(id, agent);

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

            return(Request.CreateResponse(HttpStatusCode.OK, successAPIResult));
        }
Ejemplo n.º 2
0
 public void WillCallDBLayerOnceWhenUpdate()
 {
     AgentBusinessLayer.UpdateAgent(1, new Agent());
     mockDBLayer.Verify(m => m.UpdateEntity <Agent>(It.IsAny <Agent>(), It.IsAny <int>()), Times.Once);
 }