public async void GetFullPathwayJourney_returns_expected_journey(IEnumerable <JourneyStep> journey, int totalJourneyLength, int totalQuestions, int totalInlineCareAdvices, int totalInterimCareAdvice, int totalReads, int totalSets, string startingpPathwayId, string dispositionCode, string traumaType, IDictionary <string, string> state) { var fullPathwayJourney = new FullPathwayJourney { JourneySteps = journey, StartingPathwayId = startingpPathwayId, StartingPathwayType = traumaType, DispostionCode = dispositionCode, State = state }; var request = new JsonRestRequest(BusinessApiFullJourneyUrl, Method.POST); request.AddJsonBody(fullPathwayJourney); var result = await _restClient.ExecuteAsync <List <QuestionWithAnswers> >(request); //this checks a response is returned Assert.IsNotNull(result); var questions = result.Data; //check correct journey length and make up of nodes returned Assert.AreEqual(totalJourneyLength, questions.Count); Assert.AreEqual(totalQuestions, questions.Count(q => q.Labels.Contains("Question"))); Assert.AreEqual(totalReads, questions.Count(q => q.Labels.Contains("Read"))); Assert.AreEqual(totalSets, questions.Count(q => q.Labels.Contains("Set"))); Assert.AreEqual(totalInterimCareAdvice, questions.Count(q => q.Labels.Contains("InterimCareAdvice"))); }
public async Task <JsonResult <IEnumerable <QuestionWithAnswers> > > GetFullPathwayJourney([FromBody] FullPathwayJourney fullPathwayJourney) { var journey = await _questionService.GetFullPathwayJourney(fullPathwayJourney.StartingPathwayType, fullPathwayJourney.JourneySteps.ToArray(), fullPathwayJourney.StartingPathwayId, fullPathwayJourney.DispostionCode, fullPathwayJourney.State); return(Json(journey)); }