public override void Given() { var registrationLearnerDetails = new RegisteredLearnerDetails { ProfileId = 1, Uln = 9875641231, Firstname = "Test First 1", Lastname = "Test Last 1", DateofBirth = DateTime.UtcNow.AddYears(-40) }; _registrationLearnerDetails = new List <RegisteredLearnerDetails> { registrationLearnerDetails }; LearnerRecordService.GetPendingGenderLearnersAsync().Returns(_registrationLearnerDetails); _apiResponse = new findLearnerByULNResponse { FindLearnerResponse = new FindLearnerResp { ULN = registrationLearnerDetails.Uln.ToString() } }; LearnerServiceApiClient.FetchLearnerDetailsAsync(Arg.Any <RegisteredLearnerDetails>()).Returns(_apiResponse); _expectedResult = new LearnerGenderResponse { IsSuccess = true, TotalCount = 1, LrsCount = 1, ModifiedCount = 1, SavedCount = 1 }; LearnerRecordService.ProcessLearnerGenderAsync(Arg.Any <List <LearnerRecordDetails> >()).Returns(_expectedResult); }
public override void Given() { var registrationLearnerDetails = new RegisteredLearnerDetails { ProfileId = 1, Uln = 1234567890, Firstname = "Test First 1", Lastname = "Test Last 1", DateofBirth = DateTime.UtcNow.AddYears(-40) }; _registrationLearnerDetails = new List <RegisteredLearnerDetails> { registrationLearnerDetails }; LearnerRecordService.GetPendingVerificationAndLearningEventsLearnersAsync().Returns(_registrationLearnerDetails); var apiResponse = new GetLearnerLearningEventsResponse { IncomingULN = registrationLearnerDetails.Uln.ToString(), FoundULN = registrationLearnerDetails.Uln.ToString() }; PersonalLearningRecordApiClient.GetLearnerEventsAsync(Arg.Any <RegisteredLearnerDetails>()).Returns(apiResponse); _expectedResult = new LearnerVerificationAndLearningEventsResponse { IsSuccess = true, TotalCount = 1, LrsCount = 1, ModifiedCount = 1, SavedCount = 1 }; LearnerRecordService.ProcessLearnerRecordsAsync(Arg.Any <List <LearnerRecordDetails> >()).Returns(_expectedResult); }
public override void Given() { _apiResponse = null; _registrationLearnerDetails = new List <RegisteredLearnerDetails>(); LearnerRecordService.GetPendingGenderLearnersAsync().Returns(_registrationLearnerDetails); LearnerServiceApiClient.FetchLearnerDetailsAsync(Arg.Any <RegisteredLearnerDetails>()).Returns(_apiResponse); _expectedResult = new LearnerGenderResponse { IsSuccess = true, TotalCount = 0, LrsCount = 0, ModifiedCount = 0, SavedCount = 0 }; LearnerRecordService.ProcessLearnerGenderAsync(Arg.Any <List <LearnerRecordDetails> >()).Returns(_expectedResult); }
public override void Given() { _apiResponse = null; _registrationLearnerDetails = null; LearnerRecordService.GetPendingVerificationAndLearningEventsLearnersAsync().Returns(_registrationLearnerDetails); PersonalLearningRecordApiClient.GetLearnerEventsAsync(Arg.Any <RegisteredLearnerDetails>()).Returns(_apiResponse); _expectedResult = new LearnerVerificationAndLearningEventsResponse { IsSuccess = true, TotalCount = 0, LrsCount = 0, ModifiedCount = 0, SavedCount = 0 }; LearnerRecordService.ProcessLearnerRecordsAsync(Arg.Any <List <LearnerRecordDetails> >()).Returns(_expectedResult); }
public override void Given() { CreateMapper(); _profilesData = SeedRegistrationProfilesData(); LearnerRecordServiceLogger = new Logger <LearnerRecordService>(new NullLoggerFactory()); RegistrationRepositoryLogger = new Logger <RegistrationRepository>(new NullLoggerFactory()); RegistrationRepository = new RegistrationRepository(RegistrationRepositoryLogger, DbContext); QualificationRepositoryLogger = new Logger <GenericRepository <Qualification> >(new NullLoggerFactory()); QualificationRepository = new GenericRepository <Qualification>(QualificationRepositoryLogger, DbContext); LrsService = new LearnerRecordService(Mapper, LearnerRecordServiceLogger, RegistrationRepository, QualificationRepository); }
public void Then_Expected_Methods_Are_Called() { LearnerRecordService.Received(1).GetPendingGenderLearnersAsync(); LearnerServiceApiClient.DidNotReceive().FetchLearnerDetailsAsync(Arg.Any <RegisteredLearnerDetails>()); LearnerRecordService.DidNotReceive().ProcessLearnerGenderAsync(Arg.Any <List <LearnerRecordDetails> >()); }
public void Then_Expected_Methods_Are_Called() { LearnerRecordService.Received(1).GetPendingVerificationAndLearningEventsLearnersAsync(); PersonalLearningRecordApiClient.DidNotReceive().GetLearnerEventsAsync(Arg.Any <RegisteredLearnerDetails>()); LearnerRecordService.DidNotReceive().ProcessLearnerRecordsAsync(Arg.Any <List <LearnerRecordDetails> >()); }