Beispiel #1
0
        public void ShouldReturnUniqueQualificationsEvenIfCaseIsDifferent()
        {
            // Assign
            var newLearnDelivery = new LearningDeliveryMetaData
            {
                LearnAimRef      = "new10101",
                LearnAimRefTitle = _learningDelivery.LearnAimRefTitle.ToUpperInvariant()
            };

            _learningDeliveryList.Add(newLearnDelivery);

            var newAim = new FrameworkAimMetaData
            {
                FworkCode = _framework.FworkCode,
                ApprenticeshipComponentType = _apprenticeshipComponentType.ApprenticeshipComponentType,
                LearnAimRef = newLearnDelivery.LearnAimRef
            };

            _frameworkAimList.Add(newAim);

            // Act
            var frameworks = _sut.GetListOfCurrentFrameworks();

            // Assert
            frameworks.Count().Should().Be(1);

            var framework = frameworks.First();

            framework.CompetencyQualification.Count().Should().Be(1);
            framework.KnowledgeQualification.Should().BeEmpty();
            framework.CombinedQualification.Should().BeEmpty();

            framework.CompetencyQualification.First().Should().Be(_learningDelivery.LearnAimRefTitle);
        }
Beispiel #2
0
 public LearningDeliveryDocument CreateLearningDeliveryMetaDataDocument(LearningDeliveryMetaData learningDeliveryMetaData)
 {
     return(new LearningDeliveryDocument
     {
         EffectiveFrom = learningDeliveryMetaData.EffectiveFrom,
         EffectiveTo = learningDeliveryMetaData.EffectiveTo,
         LearnAimRef = learningDeliveryMetaData.LearnAimRef,
         LearnAimRefTitle = learningDeliveryMetaData.LearnAimRefTitle,
         LearnAimRefType = learningDeliveryMetaData.LearnAimRefType
     });
 }
Beispiel #3
0
        public void Init()
        {
            _mockAngleSharpService  = new Mock <IAngleSharpService>();
            _mockAppServiceSettings = new Mock <IAppServiceSettings>();
            _mockCsvService         = new Mock <IReadMetaDataFromCsv>();
            _mockFileExtractor      = new Mock <IUnzipStream>();
            _mockHttpGetFile        = new Mock <IHttpGetFile>();
            _mockLogger             = new Mock <ILog>();

            _linkEndPoints = new List <string> {
                "endpoint"
            };
            _framework = new FrameworkMetaData
            {
                FworkCode     = 500,
                PwayCode      = 1,
                ProgType      = 2,
                EffectiveFrom = DateTime.Now.AddDays(-4),
                EffectiveTo   = DateTime.Now.AddDays(4)
            };

            _apprenticeshipComponentType = new ApprenticeshipComponentTypeMetaData
            {
                ApprenticeshipComponentType = 1,
            };

            _frameworkAim = new FrameworkAimMetaData
            {
                FworkCode = _framework.FworkCode,
                PwayCode  = _framework.PwayCode,
                ProgType  = _framework.ProgType,
                ApprenticeshipComponentType = _apprenticeshipComponentType.ApprenticeshipComponentType,
                LearnAimRef = "5001738X"
            };

            _learningDelivery = new LearningDeliveryMetaData
            {
                LearnAimRef      = _frameworkAim.LearnAimRef,
                LearnAimRefTitle = "Test Learning Delivery"
            };

            _fundingMetaData = new FundingMetaData
            {
                LearnAimRef     = _frameworkAim.LearnAimRef,
                EffectiveFrom   = DateTime.Now.AddYears(-2),
                EffectiveTo     = DateTime.Now.AddDays(20),
                FundingCategory = "APP_ACT_COST", // This category is used to determine an apprenticeship funded qualification
                RateWeighted    = 150
            };

            _appFundingMetaData = new ApprenticeshipFundingMetaData
            {
                ApprenticeshipType = "FWK",
                ApprenticeshipCode = _framework.FworkCode,
                PwayCode           = _framework.PwayCode,
                ProgType           = _framework.ProgType,
                ReservedValue1     = 18,
                MaxEmployerLevyCap = 9000
            };

            _frameworkList = new List <FrameworkMetaData> {
                _framework
            };
            _frameworkAimList = new List <FrameworkAimMetaData> {
                _frameworkAim
            };
            _apprenticeshipComponentTypeList = new List <ApprenticeshipComponentTypeMetaData> {
                _apprenticeshipComponentType
            };
            _learningDeliveryList = new List <LearningDeliveryMetaData> {
                _learningDelivery
            };
            _fundingList = new List <FundingMetaData> {
                _fundingMetaData
            };
            _fundingApprenticeshipsList = new List <ApprenticeshipFundingMetaData> {
                _appFundingMetaData
            };

            _mockHttpGetFile.Setup(m => m.GetFile(It.IsAny <string>())).Returns(new MemoryStream());
            _mockCsvService.Setup(x => x.ReadFromString <FrameworkMetaData>(It.IsAny <string>())).Returns(_frameworkList);
            _mockCsvService.Setup(x => x.ReadFromString <FrameworkAimMetaData>(It.IsAny <string>())).Returns(_frameworkAimList);
            _mockCsvService.Setup(x => x.ReadFromString <ApprenticeshipComponentTypeMetaData>(It.IsAny <string>())).Returns(_apprenticeshipComponentTypeList);
            _mockCsvService.Setup(x => x.ReadFromString <LearningDeliveryMetaData>(It.IsAny <string>())).Returns(_learningDeliveryList);
            _mockCsvService.Setup(x => x.ReadFromString <FundingMetaData>(It.IsAny <string>())).Returns(_fundingList);
            _mockCsvService.Setup(x => x.ReadFromString <ApprenticeshipFundingMetaData>(It.IsAny <string>())).Returns(_fundingApprenticeshipsList);

            _mockAngleSharpService.Setup(x => x.GetLinks(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())).Returns(_linkEndPoints);

            _mockAppServiceSettings.Setup(a => a.FrameworksExpiredRequired).Returns(new List <string>());

            _sut = new LarsDataService(
                _mockAppServiceSettings.Object,
                _mockCsvService.Object,
                _mockHttpGetFile.Object,
                _mockFileExtractor.Object,
                _mockAngleSharpService.Object,
                _mockLogger.Object);
        }