public void Setup()
        {
            _outcome = Substitute.For <Models.Outcomes>();

            _request = new HttpRequestMessage()
            {
                Content    = new StringContent(string.Empty),
                RequestUri =
                    new Uri($"http://localhost:7071/api/Customers/7E467BDB-213F-407A-B86A-1954053D3C24/" +
                            $"Interactions/aa57e39e-4469-4c79-a9e9-9cb4ef410382/" +
                            $"Outcomes/d5369b9a-6959-4bd3-92fc-1583e72b7e51")
            };

            _log                               = Substitute.For <ILogger>();
            _resourceHelper                    = Substitute.For <IResourceHelper>();
            _httpRequestMessageHelper          = Substitute.For <IHttpRequestMessageHelper>();
            _getOutcomesByIdHttpTriggerService = Substitute.For <IGetOutcomesByIdHttpTriggerService>();
            _httpRequestMessageHelper.GetTouchpointId(_request).Returns("0000000001");
        }
        public static async Task <HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "Customers/{customerId}/Interactions/{interactionId}/actionplans/{actionplanId}/Outcomes/{OutcomeId}")] HttpRequestMessage req, ILogger log, string customerId, string interactionId, string actionplanId, string OutcomeId,
                                                           [Inject] IResourceHelper resourceHelper,
                                                           [Inject] IHttpRequestMessageHelper httpRequestMessageHelper,
                                                           [Inject] IGetOutcomesByIdHttpTriggerService outcomesGetService)
        {
            var touchpointId = httpRequestMessageHelper.GetTouchpointId(req);

            if (string.IsNullOrEmpty(touchpointId))
            {
                log.LogInformation("Unable to locate 'APIM-TouchpointId' in request header.");
                return(HttpResponseMessageHelper.BadRequest());
            }

            log.LogInformation("Get Outcomes By Id C# HTTP trigger function  processed a request. " + touchpointId);

            if (!Guid.TryParse(customerId, out var customerGuid))
            {
                return(HttpResponseMessageHelper.BadRequest(customerGuid));
            }

            if (!Guid.TryParse(interactionId, out var interactionGuid))
            {
                return(HttpResponseMessageHelper.BadRequest(interactionGuid));
            }

            if (!Guid.TryParse(actionplanId, out var actionPlanGuid))
            {
                return(HttpResponseMessageHelper.BadRequest(actionPlanGuid));
            }

            if (!Guid.TryParse(OutcomeId, out var outcomesGuid))
            {
                return(HttpResponseMessageHelper.BadRequest(outcomesGuid));
            }

            //Check customer
            var doesCustomerExist = await resourceHelper.DoesCustomerExist(customerGuid);

            if (!doesCustomerExist)
            {
                return(HttpResponseMessageHelper.NoContent(customerGuid));
            }

            var doesInteractionExist = resourceHelper.DoesInteractionResourceExistAndBelongToCustomer(interactionGuid, customerGuid);

            if (!doesInteractionExist)
            {
                return(HttpResponseMessageHelper.NoContent(interactionGuid));
            }

            var doesActionPlanExist = resourceHelper.DoesActionPlanResourceExistAndBelongToCustomer(actionPlanGuid, interactionGuid, customerGuid);

            if (!doesActionPlanExist)
            {
                return(HttpResponseMessageHelper.NoContent(actionPlanGuid));
            }

            var outcomes = await outcomesGetService.GetOutcomesForCustomerAsync(customerGuid, interactionGuid, actionPlanGuid, outcomesGuid);

            return(outcomes == null?
                   HttpResponseMessageHelper.NoContent(outcomesGuid) :
                       HttpResponseMessageHelper.Ok(JsonHelper.SerializeObject(outcomes)));
        }