Example #1
0
        public override void Given()
        {
            // Seed Tlevel data for pearson
            _uln = 1111111111;
            SeedTestData(EnumAwardingOrganisation.Pearson, true);
            SeedRegistrationData(_uln);

            CreateMapper();
            ProviderRepositoryLogger                 = new Logger <ProviderRepository>(new NullLoggerFactory());
            RegistrationRepositoryLogger             = new Logger <RegistrationRepository>(new NullLoggerFactory());
            TqRegistrationPathwayRepositoryLogger    = new Logger <GenericRepository <TqRegistrationPathway> >(new NullLoggerFactory());
            TqRegistrationSpecialismRepositoryLogger = new Logger <GenericRepository <TqRegistrationSpecialism> >(new NullLoggerFactory());
            ProviderRepository                 = new ProviderRepository(ProviderRepositoryLogger, DbContext);
            RegistrationRepository             = new RegistrationRepository(RegistrationRepositoryLogger, DbContext);
            TqRegistrationPathwayRepository    = new GenericRepository <TqRegistrationPathway>(TqRegistrationPathwayRepositoryLogger, DbContext);
            TqRegistrationSpecialismRepository = new GenericRepository <TqRegistrationSpecialism>(TqRegistrationSpecialismRepositoryLogger, DbContext);
            RegistrationService                = new RegistrationService(ProviderRepository, RegistrationRepository, TqRegistrationPathwayRepository, TqRegistrationSpecialismRepository, RegistrationMapper, RegistrationRepositoryLogger);

            var reregisterTlProvider         = TqProviders.Last().TlProvider;
            var reregisterPathway            = TqProviders.Last().TqAwardingOrganisation.TlPathway;
            var reregisterPathwaySpecialisms = new TlSpecialismBuilder().BuildList(EnumAwardingOrganisation.Pearson, reregisterPathway);

            _reRegistrationRequest = new ReregistrationRequest
            {
                AoUkprn         = TlAwardingOrganisation.UkPrn,
                ProviderUkprn   = reregisterTlProvider.UkPrn,
                AcademicYear    = DateTime.UtcNow.Year,
                CoreCode        = reregisterPathway.LarId,
                SpecialismCodes = reregisterPathwaySpecialisms.Select(s => s.LarId),
                PerformedBy     = "Test User"
            };
        }
        public override void Given()
        {
            var tlSpecialisms = new TlSpecialismBuilder().BuildList(_awardingOrganisation);

            DbContext.AddRange(tlSpecialisms);
            DbContext.SaveChanges();
            _data = tlSpecialisms.FirstOrDefault();
        }
        public static IList <TlSpecialism> CreateTlSpecialisms(ResultsAndCertificationDbContext _dbContext, EnumAwardingOrganisation awardingOrganisation, TlPathway tlPathway, bool addToDbContext = true)
        {
            var tlSpecialisms = new TlSpecialismBuilder().BuildList(awardingOrganisation, tlPathway);

            if (addToDbContext && tlSpecialisms != null)
            {
                _dbContext.AddRange(tlSpecialisms);
            }
            return(tlSpecialisms);
        }
        public override void Given()
        {
            var specialisms = new TlSpecialismBuilder().BuildList(_awardingOrganisation);

            _data = specialisms.FirstOrDefault();
            DbContext.Add(_data);
            DbContext.SaveChanges();

            // Update data
            _data.Name       = SpecialismName;
            _data.LarId      = LarId;
            _data.ModifiedBy = ModifiedBy;
        }
Example #5
0
        private void SeedRegistrationData(long uln)
        {
            _initialRegisteredTqProvider = TqProviders.First();
            var profile = new TqRegistrationProfileBuilder().BuildList().FirstOrDefault(p => p.UniqueLearnerNumber == uln);
            var tqRegistrationProfile = RegistrationsDataProvider.CreateTqRegistrationProfile(DbContext, profile);
            var tqRegistrationPathway = RegistrationsDataProvider.CreateTqRegistrationPathway(DbContext, tqRegistrationProfile, _initialRegisteredTqProvider);

            var specialisms = new TlSpecialismBuilder().BuildList(EnumAwardingOrganisation.Pearson, _initialRegisteredTqProvider.TqAwardingOrganisation.TlPathway);

            foreach (var specialism in specialisms)
            {
                tqRegistrationPathway.TqRegistrationSpecialisms.Add(RegistrationsDataProvider.CreateTqRegistrationSpecialism(DbContext, tqRegistrationPathway, specialism));
            }

            DbContext.SaveChangesAsync();
        }
Example #6
0
        public override void Given()
        {
            var tlSpecialisms = new TlSpecialismBuilder().BuildList(_awardingOrganisation);

            _data = tlSpecialisms.FirstOrDefault();
        }