public HttpResponseMessage Get(int id) { var agentAPIResult = new AgentAPIResult() { Usage = "HttpGet:~/api/Agent/{id} or {args} can be on querystring, {args?} are optional" }; agentAPIResult.Agent = AgentBusinessLayer.GetAgent(id); if (agentAPIResult.Agent == null) { return(Request.CreateResponse(HttpStatusCode.NotFound, agentAPIResult)); } return(Request.CreateResponse(HttpStatusCode.OK, agentAPIResult)); }
public void WillCallDBLayerOnceWhenGetById() { AgentBusinessLayer.GetAgent(1); mockDBLayer.Verify(m => m.FindEntity <Agent>(It.IsAny <int>()), Times.Once); }