Inheritance: IPathwayRepository
        public async void GetPathway_with_invalid_id_returns_null()
        {
            _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);

            var res = await _pathwayRepository.GetPathway("PX");
            Assert.IsNull(res);
        }
        public async void GetIdentifiedPathway_with_invalid_gender_returns_null()
        {
            MockPathwaysConfigurationManager.Setup(m => m.UseLivePathways).Returns(false);
            _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);

            var res = await _pathwayRepository.GetIdentifiedPathway(new[] { "PW103" }, "Male", 25);
            Assert.IsNull(res);
        }
        public async void GetIdentifiedPathway_with_valid_params_returns_pathway()
        {
            MockPathwaysConfigurationManager.Setup(m => m.UseLivePathways).Returns(false);
            _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);

            var res = await _pathwayRepository.GetIdentifiedPathway(new[] {"PW102"}, "Male", 25);
            Assert.AreEqual(res.PathwayNo, "PW102");
        }
        public async void GetPathway_when_only_using_live_for_valid_id_not_live_returns_null()
        {
            MockPathwaysConfigurationManager.Setup(m => m.UseLivePathways).Returns(true);
            _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);

            var res = await _pathwayRepository.GetPathway("P2");
            Assert.IsNull(res);
        }
 public async void GetPathway_with_valid_id_returns_pathway()
 {
     MockPathwaysConfigurationManager.Setup(m => m.UseLivePathways).Returns(false);
     _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);
     
     var res = await _pathwayRepository.GetPathway("P2");
     Assert.IsNotNull(res);
     Assert.AreEqual(res.PathwayNo, "PW101");
 }
        public async void GetIdentifiedPathway_when_only_using_live_for_valid_params_not_live_returns_null()
        {
            MockPathwaysConfigurationManager.Setup(m => m.UseLivePathways).Returns(true);
            _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);

            var res = await _pathwayRepository.GetIdentifiedPathway(new[] { "PW102" }, "Male", 25);
            Assert.IsNull(res);
        }
        public async void GetGroupedPathways_when_only_using_live_returns_grouped_pathways()
        {
            MockPathwaysConfigurationManager.Setup(m => m.UseLivePathways).Returns(true);
            _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);

            var liveOnlyPathways = PathwaysConfigurationManager.GetLivePathwaysElements().Select(e => e.Title);
            var liveOnlyDistinctPathways = Pathways.Where(p => p.Module == "1" && liveOnlyPathways.Contains(p.Title)).Select(p => p.Title).Distinct();

            var res = await _pathwayRepository.GetGroupedPathways();
            Assert.AreEqual(res.Count(), liveOnlyDistinctPathways.Count());
        }
        public async void GetGroupedPathways_returns_grouped_pathways()
        {
            MockPathwaysConfigurationManager.Setup(m => m.UseLivePathways).Returns(false);
            _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);

            var allDistinctPathways = Pathways.Where(p => p.Module == "1").Select(p => p.Title).Distinct();

            var res = await _pathwayRepository.GetGroupedPathways();
            Assert.AreEqual(res.Count(), allDistinctPathways.Count());
        }
 public async void GetAllPathways_when_only_using_live_returns_only_live_pathways()
 {
     MockPathwaysConfigurationManager.Setup(m => m.UseLivePathways).Returns(true);
     _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);
     
     var liveOnlyPathways = PathwaysConfigurationManager.GetLivePathwaysElements().Select(e => e.Title);
     
     var res = await _pathwayRepository.GetAllPathways();
     Assert.AreEqual(res.Count(), Pathways.Count(p => liveOnlyPathways.Contains(p.Title)));
 }
        public async void GetAllPathways_returns_all_pathways()
        {
            MockPathwaysConfigurationManager.Setup(m => m.UseLivePathways).Returns(false);
            _pathwayRepository = new PathwayRepository(GraphRepository, MockPathwaysConfigurationManager.Object);

            var res = await _pathwayRepository.GetAllPathways();
            Assert.AreEqual(res.Count(), Pathways.Count());
        }