Пример #1
0
        public void SetupStandardOptionsTable()
        {
            _databaseConnection = new SqlConnection(_databaseService.WebConfiguration.SqlConnectionString);
            _unitOfWork         = new UnitOfWork(_databaseConnection);
            _repository         = new StandardRepository(_unitOfWork);

            _options   = GetListOfOptions();
            _standards = GetListOfStandardVersions();

            StandardOptionsHandler.InsertRecords(_options);
            StandardsHandler.InsertRecords(_standards);

            _expectedStandardResult = new StandardOptions
            {
                StandardUId       = "ST0001_1.1",
                StandardReference = "ST0001",
                StandardCode      = 1,
                Version           = "1.1",
                CourseOption      = new List <string>
                {
                    "ST0001_1.1 Option 1",
                    "ST0001_1.1 Option 2"
                }
            };
        }
        public void SetUpStandardsTable()
        {
            _databaseConnection = new SqlConnection(_databaseService.WebConfiguration.SqlConnectionString);
            _unitOfWork         = new UnitOfWork(_databaseConnection);
            _repository         = new OppFinderRepository(_unitOfWork);

            _nonApprovedStandards = GetListOfNonApprovedStandard();

            StandardsHandler.InsertRecords(_nonApprovedStandards);
        }
Пример #3
0
        public void SetupStandardsTable()
        {
            _databaseConnection = new SqlConnection(_databaseService.WebConfiguration.SqlConnectionString);
            _unitOfWork         = new UnitOfWork(_databaseConnection);
            _repository         = new StandardRepository(_unitOfWork);

            _standards = GetListOfStandardVersions();

            StandardsHandler.InsertRecords(_standards);
        }
        public void SetupOrganisationTests()
        {
            var databaseConnection = new SqlConnection(_databaseService.WebConfiguration.SqlConnectionString);
            var unitOfWork         = new UnitOfWork(databaseConnection);

            _repository = new RegisterQueryRepository(unitOfWork);

            _organisationIdCreated = "EPA0987";
            _organisationId1       = "EPA0987";
            _organisation1         = new OrganisationModel
            {
                Id                             = Guid.NewGuid(),
                CreatedAt                      = DateTime.Now.AddYears(-1).Date,
                DeletedAt                      = null,
                EndPointAssessorName           = "Name 1",
                EndPointAssessorOrganisationId = _organisationId1,
                EndPointAssessorUkprn          = 876544,
                PrimaryContact                 = null,
                Status                         = "new",
                UpdatedAt                      = null,
                OrganisationTypeId             = null,
                OrganisationData               = null
            };

            _organisationStandard = new OrganisationStandardModel
            {
                Id = _orgStandardId,
                EndPointAssessorOrganisationId = _organisationIdCreated,
                StandardCode  = _standardCode,
                Status        = OrganisationStatus.New,
                EffectiveFrom = DateTime.Today.AddDays(-7),
                EffectiveTo   = DateTime.Today.AddDays(10),
                DateStandardApprovedOnRegister = DateTime.Today.AddDays(-50),
                Comments = "comments go here"
            };

            _deliveryArea1 = new DeliveryAreaModel {
                Id = 10, Status = "Live", Area = "North West"
            };
            _deliveryArea2 = new DeliveryAreaModel {
                Id = 20, Status = "New", Area = "Some Other"
            };
            var deliveryAreas = new List <DeliveryAreaModel> {
                _deliveryArea1, _deliveryArea2
            };

            DeliveryAreaHandler.InsertRecords(deliveryAreas);

            var deliveryArea1 = new OrganisationStandardDeliveryAreaModel
            {
                Id                     = _deliveryAreaId1,
                Comments               = "comments 1",
                DeliveryAreaId         = _deliveryArea1.Id,
                OrganisationStandardId = _orgStandardId,
                Status                 = OrganisationStatus.New,
            };

            var deliveryArea2 = new OrganisationStandardDeliveryAreaModel
            {
                Id                     = _deliveryAreaId2,
                Comments               = "comments 1",
                DeliveryAreaId         = _deliveryArea2.Id,
                OrganisationStandardId = _orgStandardId,
                Status                 = OrganisationStatus.New
            };

            var organistionStandardVersion1 = new OrganisationStandardVersionModel
            {
                OrganisationStandardId = _orgStandardId,
                StandardUId            = _standardUID1,
                EffectiveFrom          = DateTime.Now.AddMonths(-12),
                EffectiveTo            = DateTime.Now.AddMonths(-3),
                Version             = "1.0",
                DateVersionApproved = DateTime.Now.AddMonths(-12),
                Status = "Live"
            };

            var organistionStandardVersion2 = new OrganisationStandardVersionModel
            {
                OrganisationStandardId = _orgStandardId,
                StandardUId            = _standardUID2,
                EffectiveFrom          = DateTime.Now.AddMonths(-3),
                EffectiveTo            = null,
                Version             = "1.1",
                DateVersionApproved = DateTime.Now.AddMonths(-3),
                Status = "Live"
            };

            var standardModel1 = new StandardModel
            {
                StandardUId          = _standardUID1,
                IFateReferenceNumber = "ST0001",
                Version            = "1.0",
                Title              = "Standard",
                Level              = 4,
                Status             = "Approved for Delivery",
                TypicalDuration    = 12,
                TrailblazerContact = "Contact name",
                StandardPageUrl    = "www.standard.com",
                OverviewOfRole     = "Explanation of apprenticeship job role"
            };

            var standardModel2 = new StandardModel
            {
                StandardUId          = _standardUID2,
                IFateReferenceNumber = "ST0001",
                Version            = "1.1",
                Title              = "Standard",
                Level              = 4,
                Status             = "Approved for Delivery",
                TypicalDuration    = 12,
                TrailblazerContact = "Contact name",
                StandardPageUrl    = "www.standard.com",
                OverviewOfRole     = "Explanation of apprenticeship job role"
            };

            OrganisationHandler.InsertRecords(new List <OrganisationModel> {
                _organisation1
            });
            OrganisationStandardHandler.InsertRecord(_organisationStandard);
            OrganisationStandardDeliveryAreaHandler.InsertRecords(new List <OrganisationStandardDeliveryAreaModel> {
                deliveryArea1, deliveryArea2
            });
            OrganisationStandardVersionHandler.InsertRecord(organistionStandardVersion1);
            OrganisationStandardVersionHandler.InsertRecord(organistionStandardVersion2);

            StandardsHandler.InsertRecords(new List <StandardModel> {
                standardModel1, standardModel2
            });
        }