public async Task Arrange() { _request = Builder <GetBatchCertificateRequest> .CreateNew() .With(i => i.Uln = 1234567890) .With(i => i.StandardCode = 101) .With(i => i.StandardReference = null) .With(i => i.UkPrn = 12345678) .With(i => i.FamilyName = "Test") .Build(); var organisationResponse = Builder <Organisation> .CreateNew().Build(); var certificateResponse = Builder <Certificate> .CreateNew().Build(); OrganisationQueryRepositoryMock.Setup(o => o.GetByUkPrn(_request.UkPrn)) .ReturnsAsync(organisationResponse); CertificateRepositoryMock.Setup(c => c.GetCertificateByUlnOrgIdLastnameAndStandardCode(_request.Uln, organisationResponse.EndPointAssessorOrganisationId, _request.FamilyName, _request.StandardCode)) .ReturnsAsync(certificateResponse); _validationResult = await Validator.ValidateAsync(_request); }
public void Then_GetLearner_GetCertificate_GetEpaoStandards_AreCalledOnce() { LearnerRepositoryMock.Verify(repo => repo.Get(_request.Uln, _request.StandardCode), Times.Once()); CertificateRepositoryMock.Verify(repo => repo.GetCertificate(_request.Uln, _request.StandardCode), Times.Once()); StandardServiceMock.Verify(service => service.GetEpaoRegisteredStandards("99999999"), Times.Once()); }
public void ThenGetCertificateIsNotCalled() { CertificateRepositoryMock.Verify(repo => repo.GetCertificate(_request.Uln, _request.StandardCode), Times.Never()); }