public override void Given() { _expectedAddress = new Address { AddressId = 1, DepartmentName = "Operations", OrganisationName = "College Ltd", AddressLine1 = "10, House", AddressLine2 = "Street", Town = "Birmingham", Postcode = "B1 1AA" }; _expectedSnapshotDetails = new SoaPrintingDetails { 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 = _expectedAddress }; _expectedApiResult = new PrintRequestSnapshot { RegistrationPathwayStatus = RegistrationPathwayStatus.Withdrawn, RequestedBy = "John Smith", RequestedOn = DateTime.Today, RequestDetails = JsonConvert.SerializeObject(_expectedSnapshotDetails) }; InternalApiClient.GetPrintRequestSnapshotAsync(ProviderUkprn, ProfileId, PathwayId).Returns(_expectedApiResult); }
public async Task WhenAsync(long providerUkprn, long uln) { if (_actualResult != null) { return; } var profile = _profiles.FirstOrDefault(x => x.UniqueLearnerNumber == uln); var profileId = profile?.Id ?? 0; int pathwayId = profile?.TqRegistrationPathways?.FirstOrDefault(x => x.TqRegistrationProfileId == profileId)?.TqRegistrationProfileId ?? 0; _actualResult = await StatementOfAchievementService.GetPrintRequestSnapshotAsync(providerUkprn, profileId, pathwayId); }
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\"}}" }; }
public override void Given() { _expectedApiResult = null; InternalApiClient.GetPrintRequestSnapshotAsync(Arg.Any <long>(), Arg.Any <int>(), Arg.Any <int>()).Returns(_expectedApiResult); }
public async override Task When() { _actualResult = await _apiClient.GetPrintRequestSnapshotAsync(_providerUkprn, _profileId, _pathwayId); }