public new void SetUp() { var fixture = new Fixture(); _receiverMatches = fixture.Create <List <Domain.Entities.TransferRequestSummary> >(); _senderMatches = fixture.Create <List <Domain.Entities.TransferRequestSummary> >(); _receiverMapperMatches = fixture.Create <List <Types.Commitment.TransferRequestSummary> >(); _senderMapperMatches = fixture.Create <List <Types.Commitment.TransferRequestSummary> >(); MockMediator.Setup(x => x.SendAsync(It.IsAny <GetTransferRequestsForReceiverRequest>())) .ReturnsAsync(new GetTransferRequestsForReceiverResponse() { Data = _receiverMatches }); MockMediator.Setup(x => x.SendAsync(It.IsAny <GetTransferRequestsForSenderRequest>())) .ReturnsAsync(new GetTransferRequestsForSenderResponse() { Data = _senderMatches }); MockTransferRequestMapper.Setup(x => x.MapFrom(It.IsAny <IList <Domain.Entities.TransferRequestSummary> >(), TransferType.AsReceiver)) .Returns(_receiverMapperMatches); MockTransferRequestMapper.Setup(x => x.MapFrom(It.IsAny <IList <Domain.Entities.TransferRequestSummary> >(), TransferType.AsSender)) .Returns(_senderMapperMatches); MockHashingService.Setup(x => x.DecodeValue(It.IsAny <string>())).Returns((string param) => Convert.ToInt64(param)); }
public new void Setup() { MockMediator.Setup(x => x.SendAsync(It.IsAny <GetApprenticeshipQueryRequest>())) .ReturnsAsync(new GetApprenticeshipQueryResponse { Apprenticeship = new Apprenticeship() { StartDate = DateTime.Now } }); _apprenticeshipMapper = new Mock <IApprenticeshipMapper>(); _apprenticeshipMapper .Setup(x => x.MapToEditApprenticeshipStopDateViewModel(It.IsAny <Apprenticeship>())) .Returns(new EditApprenticeshipStopDateViewModel()); Orchestrator = new EmployerManageApprenticeshipsOrchestrator( MockMediator.Object, MockHashingService.Object, _apprenticeshipMapper.Object, Validator, MockDateTime.Object, new Mock <ILog>().Object, new Mock <ICookieStorageService <UpdateApprenticeshipViewModel> >().Object, AcademicYearDateProvider.Object, AcademicYearValidator, MockLinkGenerator.Object); MockHashingService.Setup(x => x.DecodeValue(HashedApprenticeshipId)).Returns(ApprenticeshipId); MockHashingService.Setup(x => x.DecodeValue(HashedAccountId)).Returns(AccountId); }
public void Arrange() { Account = new Account { Id = AccountId, ApprenticeshipEmployerType = CommitmentsV2.Types.ApprenticeshipEmployerType.Levy }; MockEmployerAccountService.Setup(x => x.GetAccount(It.IsAny <long>())).ReturnsAsync(Account); MockHashingService.Setup(x => x.DecodeValue(It.IsAny <string>())).Returns((string param) => Convert.ToInt64(param.Remove(0, 3))); }
public async Task ThenCommitmentDetailsShouldBeReturned() { MockHashingService.Setup(h => h.HashValue(CommitmentView.Id)).Returns("HashedCmtId"); var result = await EmployerCommitmentOrchestrator.GetCommitmentDetails("HashedAccId", "HashedCmtId", "ExtUserId"); Assert.AreEqual("HashedAccId", result.Data.HashedAccountId); Assert.AreEqual("HashedCmtId", result.Data.HashedId); Assert.AreEqual(CommitmentView.AccountLegalEntityPublicHashedId, result.Data.AccountLegalEntityPublicHashedId); }
public void Arrange() { _transferRequest = new TransferRequest(); MockMediator.Setup(x => x.SendAsync(It.IsAny <GetTransferRequestQueryRequest>())) .ReturnsAsync(new GetTransferRequestQueryResponse { TransferRequest = _transferRequest }); _transferRequestViewModel = new TransferRequestViewModel(); MockCommitmentMapper.Setup(x => x.MapToTransferRequestViewModel(It.IsAny <TransferRequest>())) .Returns(_transferRequestViewModel); MockHashingService.Setup(x => x.DecodeValue("ABC123")).Returns(123); MockHashingService.Setup(x => x.DecodeValue("XYZ789")).Returns(789); }
public void Arrange() { MockHashingService.Setup(x => x.DecodeValue(It.IsAny <string>())).Returns((string param) => Convert.ToInt64(param.Remove(0, 3))); }