public void RemoveFleet_Return_ResponseWithStatusofbool() { var guid = new RemoveFleet() { FleetId = "ab2bd817-98cd-4cf3-a80a-53ea0cd9c200" }; var result = _controller.RemoveFleet(guid).Value; Assert.IsType <Response>(result); }
public async Task <ActionResult <Response> > RemoveFleet(RemoveFleet fleetId) { try { if (fleetId == null) { return(new Response() { ResponseCode = HttpStatusCode.BadRequest, Message = "Fleet cannot be empty", Status = false }); } var fleet = new Guid(fleetId.FleetId); var status = await _dataService.RemoveFleet(fleet); if (status) { return(new Response() { ResponseCode = HttpStatusCode.OK, Message = "Removed Successfully", Status = true }); } else { return(new Response() { ResponseCode = HttpStatusCode.NotFound, Message = "Removal not Successful", Status = false }); } } catch (Exception e) { return(new Response { Status = false, Message = "Something went wrong from our part, and we are currently working on it.", ResponseCode = HttpStatusCode.OK }); } }