public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new AddLearnerRecordResponse
            {
                Uln       = 1234567891,
                Name      = "Test User",
                IsSuccess = true
            };

            _model = new AddLearnerRecordRequest
            {
                Ukprn = 58974561,
                Uln   = 1234567891,
                HasLrsEnglishAndMaths   = false,
                EnglishAndMathsStatus   = EnglishAndMathsStatus.AchievedWithSend,
                IndustryPlacementStatus = IndustryPlacementStatus.Completed,
                PerformedBy             = "Test User"
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();
            _configuration      = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new ProviderTlevels
            {
                Id          = 1,
                DisplayName = "Test1",
                Ukprn       = _ukprn,
                Tlevels     = new List <ProviderTlevel>
                {
                    new ProviderTlevel {
                        TqAwardingOrganisationId = 1, TlProviderId = 1, TlevelTitle = "Tlevel Title1"
                    },
                    new ProviderTlevel {
                        TqAwardingOrganisationId = 1, TlProviderId = 1, TlevelTitle = "Tlevel Title2"
                    }
                }
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();
            _configuration      = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockApiResponse = new LearnerRecordDetails
            {
                ProfileId                 = _profileId,
                Uln                       = _uln,
                Name                      = "Test User",
                DateofBirth               = DateTime.UtcNow.AddYears(30),
                ProviderName              = "Barnsley College (123456789)",
                PathwayName               = "Course name (5689745)",
                IsLearnerRegistered       = true,
                IsLearnerRecordAdded      = false,
                IsEnglishAndMathsAchieved = true,
                HasLrsEnglishAndMaths     = true,
                IsSendLearner             = false,
                IndustryPlacementId       = 7,
                IndustryPlacementStatus   = Common.Enum.IndustryPlacementStatus.CompletedWithSpecialConsideration
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = true;
            _model          = new ManageRegistration
            {
                ProfileId       = 1,
                AoUkprn         = 1234567890,
                FirstName       = "First",
                LastName        = "Last",
                DateOfBirth     = "07/01/1987".ToDateTime(),
                ProviderUkprn   = 98765432,
                CoreCode        = "7654321",
                SpecialismCodes = new List <string> {
                    "23456789", "7654321"
                },
                PerformedBy = "Test User"
            };
        }
Example #5
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new AddResultResponse
            {
                IsSuccess = true,
                Uln       = 1234567890,
                ProfileId = 11
            };

            _model = new AddResultRequest
            {
                AoUkprn       = 1,
                ProfileId     = 11,
                AssessmentId  = 1,
                LookupId      = 1,
                ComponentType = Common.Enum.ComponentType.Core,
                PerformedBy   = "Test User"
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new BulkAssessmentResponse
            {
                IsSuccess           = false,
                BlobUniqueReference = Guid.NewGuid(),
                ErrorFileSize       = 1.5
            };

            _model = new BulkProcessRequest
            {
                AoUkprn             = _ukprn,
                BlobFileName        = "assessmenttfile.csv",
                BlobUniqueReference = Guid.NewGuid()
            };
        }
Example #7
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new RegistrationDetails
            {
                ProfileId    = 1,
                Uln          = 1234567890,
                Firstname    = "John",
                Lastname     = "Smith",
                DateofBirth  = DateTime.UtcNow,
                ProviderName = "Test Provider (1234567)",
                PathwayName  = "Pathway (7654321)",
                Specialisms  = new List <SpecialismDetails> {
                    new SpecialismDetails {
                        Code = "2345678", Name = "Specialism1"
                    }, new SpecialismDetails {
                        Code = "55567", Name = "Specialism2"
                    }
                },
                AcademicYear = 2020,
                Status       = RegistrationPathwayStatus.Active
            };
        }
        public override void Setup()
        {
            _pathwayComponentGrade = LookupCategory.PathwayComponentGrade;
            _tokenServiceClient    = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new List <LookupData>
            {
                new LookupData {
                    Id = 1, Code = "C1", Value = "V1"
                },
                new LookupData {
                    Id = 2, Code = "C2", Value = "V2"
                },
                new LookupData {
                    Id = 3, Code = "C3", Value = "V3"
                },
            };
        }
Example #9
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new List <PathwayDetails>
            {
                new PathwayDetails
                {
                    Id   = 1,
                    Name = "Test",
                    Code = "10000111"
                },
                new PathwayDetails
                {
                    Id   = 2,
                    Name = "Display",
                    Code = "10000112"
                }
            };
        }
Example #10
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new AssessmentDetails
            {
                ProfileId                  = 1,
                Uln                        = 1234567890,
                Firstname                  = "John",
                Lastname                   = "Smith",
                ProviderUkprn              = 1234567,
                ProviderName               = "Test Provider",
                PathwayLarId               = "7654321",
                PathwayName                = "Pathway",
                PathwayAssessmentSeries    = "Summer 2021",
                PathwayAssessmentId        = 1,
                SpecialismLarId            = "2345678",
                SpecialismName             = "Specialism1",
                SpecialismAssessmentSeries = "Autumn 2022",
                SpecialismAssessmentId     = 25,
                Status                     = RegistrationPathwayStatus.Active
            };
        }
 public ResultsAndCertificationInternalApiClient(HttpClient httpClient, ITokenServiceClient tokenService, ResultsAndCertificationConfiguration configuration)
 {
     _tokenServiceClient = tokenService;
     _httpClient         = httpClient;
     _httpClient.DefaultRequestHeaders.Accept.Clear();
     _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
     _internalApiUri         = configuration.ResultsAndCertificationInternalApiUri.TrimEnd('/');
     _httpClient.BaseAddress = new System.Uri(_internalApiUri);
 }
 public DfeSignInApiClient(HttpClient httpClient, ITokenServiceClient tokenService, ResultsAndCertificationConfiguration configuration)
 {
     _clientId           = configuration.DfeSignInSettings.ClientId;
     _tokenServiceClient = tokenService;
     _httpClient         = httpClient;
     _httpClient.DefaultRequestHeaders.Accept.Clear();
     _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
     _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _tokenServiceClient.GetDfeApiToken());
     _dfeSignInApiUri        = configuration.DfeSignInSettings.ApiUri.TrimEnd('/');
     _httpClient.BaseAddress = new Uri(_dfeSignInApiUri);
 }
Example #13
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };
            _mockHttpResult = true;
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new List <AwardingOrganisationPathwayStatus>
            {
                new AwardingOrganisationPathwayStatus {
                    TlevelTitle = TlevelTitle, StatusId = StatusId
                }
            };
        }
Example #15
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();
            _configuration      = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockApiResponse = new PrintRequestSnapshot
            {
                RegistrationPathwayStatus = RegistrationPathwayStatus.Withdrawn,
                RequestedBy    = "John Smith",
                RequestedOn    = DateTime.Today,
                RequestDetails = "{\"Uln\":1234567890,\"Name\":\"First 1 Last 1\",\"Dateofbirth\":\"01 January 2006\",\"ProviderName\":\"Barnsley College (10000536)\",\"TlevelTitle\":\"T Level in Healthcare Science\",\"Core\":\"Healthcare Science (10923456)\",\"CoreGrade\":\"B\",\"Specialism\":\"Optical Care Services (38234567)\",\"SpecialismGrade\":\"None\",\"EnglishAndMaths\":\"Achieved minimum standard (Data from the Learning Records Service - LRS)\",\"IndustryPlacement\":\"Placement completed\",\"ProviderAddress\":{\"AddressId\":1,\"DepartmentName\":\"Operations\",\"OrganisationName\":\"College Ltd\",\"AddressLine1\":\"10, House\",\"AddressLine2\":\"Street\",\"Town\":\"Birmingham\",\"Postcode\":\"B1 1AA\"}}"
            };
        }
Example #16
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new AvailableAssessmentSeries
            {
                ProfileId            = _profileId,
                AssessmentSeriesId   = 11,
                AssessmentSeriesName = "Summer 2021"
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new FindUlnResponse
            {
                RegistrationProfileId = 1,
                Uln = _uln,
                IsRegisteredWithOtherAo = true,
                Status = Common.Enum.RegistrationPathwayStatus.Active
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = true;
            _model          = new VerifyTlevelDetails
            {
                TqAwardingOrganisationId = 1,
                PathwayStatusId          = 2,
                ModifiedBy = "Test User"
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = true;
            _model          = new WithdrawRegistrationRequest
            {
                ProfileId   = 1,
                AoUkprn     = 1234567890,
                PerformedBy = "Test User"
            };
        }
Example #20
0
        public override void Setup()
        {
            _ukprn = 987654321;
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new LoggedInUserTypeInfo
            {
                Ukprn    = _ukprn,
                Name     = "Test",
                UserType = LoginUserType.AwardingOrganisation
            };
        }
Example #21
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://xtz.com"
                }
            };

            _mockHttpResult = new TlevelPathwayDetails
            {
                PathwayName     = PathwayName,
                RouteName       = RouteName,
                Specialisms     = Specialisms,
                PathwayStatusId = Status
            };
            HttpClient = new HttpClient(new MockHttpMessageHandler <TlevelPathwayDetails>(_mockHttpResult, string.Format(ApiConstants.TlevelDetailsUri, ukprn, tlevelId), HttpStatusCode.OK));
        }
Example #22
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();
            _configuration      = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockApiResponse = new Address
            {
                DepartmentName   = "Dept",
                OrganisationName = "Org",
                AddressLine1     = "Line1",
                AddressLine2     = "Line2",
                Town             = "Town",
                Postcode         = "x11 1yy"
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();
            _configuration      = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://provider.api.com"
                }
            };

            _mockHttpResult = new List <ProviderMetadata>
            {
                new ProviderMetadata {
                    Id = 1, DisplayName = "Test provider 1"
                },
                new ProviderMetadata {
                    Id = 2, DisplayName = "Test provider 2"
                },
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = true;

            _model = new RemoveAssessmentEntryRequest
            {
                AoUkprn       = 1,
                AssessmentId  = 5,
                ComponentType = Common.Enum.ComponentType.Core,
                PerformedBy   = "Test User"
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();
            _configuration      = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "https://test.xyz.com"
                }
            };

            _mockHttpResult = new List <AwardingOrganisationPathwayStatus>
            {
                new AwardingOrganisationPathwayStatus {
                    TlevelTitle = TlevelTitle, StatusId = Status
                }
            };

            HttpClient = new HttpClient(
                new MockHttpMessageHandler <IEnumerable <AwardingOrganisationPathwayStatus> >(
                    _mockHttpResult, string.Format(ApiConstants.GetAllTLevelsUri, ukprn), HttpStatusCode.OK));
        }
Example #26
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };
            _mockHttpResult = true;
            _model          = new List <ProviderTlevel>
            {
                new ProviderTlevel {
                    TqAwardingOrganisationId = 1, TlProviderId = 1
                },
                new ProviderTlevel {
                    TqAwardingOrganisationId = 1, TlProviderId = 1
                }
            };
        }
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new ProviderTlevelDetails
            {
                Id             = 1,
                DisplayName    = "Test",
                Ukprn          = 123456,
                ProviderTlevel = new ProviderTlevel {
                    TlevelTitle = "Tlevel Title1"
                }
            };
        }
Example #28
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new DocumentUploadHistoryDetails
            {
                TlAwardingOrganisationId = 1,
                AoUkprn             = _ukprn,
                BlobUniqueReference = Guid.NewGuid(),
                BlobFileName        = "inputfile.csv",
                DocumentType        = (int)DocumentType.Registrations,
                FileType            = (int)FileType.Csv,
                Status = (int)BulkProcessStatus.Processed
            };
        }
Example #29
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();
            _configuration      = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockApiResponse = new FindLearnerRecord
            {
                Uln                       = _uln,
                Name                      = "Test User",
                DateofBirth               = DateTime.UtcNow.AddYears(30),
                ProviderName              = "Barnsley College (123456789)",
                IsLearnerRegistered       = true,
                IsLearnerRecordAdded      = false,
                IsEnglishAndMathsAchieved = true,
                HasLrsEnglishAndMaths     = true
            };
        }
Example #30
0
        public override void Setup()
        {
            _tokenServiceClient = Substitute.For <ITokenServiceClient>();

            _configuration = new ResultsAndCertificationConfiguration
            {
                ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings {
                    Uri = "http://tlevel.api.com"
                }
            };

            _mockHttpResult = new AssessmentDetails
            {
                ProfileId     = 1,
                Uln           = 1234567890,
                Firstname     = "John",
                Lastname      = "Smith",
                ProviderUkprn = 1234567,
                ProviderName  = "Test Provider",
                Status        = RegistrationPathwayStatus.Active
            };
        }