public void Get_IntroductionPageId_For_Given_Sequence(string pageId, int sequenceId, int providerTypeId) { var startupPage = new StartupPage { PageId = pageId, ProviderTypeId = providerTypeId }; var taskListConfiguration = new TaskListConfiguration { Id = sequenceId, Title = "test configuration", StartupPages = new List <StartupPage> { startupPage, new StartupPage { PageId = pageId + "A", ProviderTypeId = providerTypeId + 1 }, new StartupPage { PageId = pageId + "Z", ProviderTypeId = providerTypeId - 1 }, } }; _configuration.Setup(x => x.Value).Returns(new List <TaskListConfiguration> { taskListConfiguration }); _service = new ProcessPageFlowService(_qnaApiClient.Object, _configuration.Object); var returnedPageId = _service.GetIntroductionPageIdForSequence(sequenceId, providerTypeId).Result; Assert.AreEqual(pageId, returnedPageId); }
public void Get_Application_ProviderTypeId_For_Given_Sequence(string providerTypeId, int expectedProviderTypeId) { var answer = new Answer { QuestionId = "test-x", Value = providerTypeId }; _qnaApiClient.Setup(x => x.GetAnswerByTag(_applicationId, RoatpWorkflowQuestionTags.ProviderRoute, It.IsAny <string>())) .ReturnsAsync(answer); _service = new ProcessPageFlowService(_qnaApiClient.Object, _configuration.Object); var returnedProviderTypeId = _service.GetApplicationProviderTypeId(_applicationId).Result; Assert.AreEqual(expectedProviderTypeId, returnedProviderTypeId); }