private Email MapToEmail(TeamMemberViewModel recipient, TransferRequestSummary transferRequest, string accountHashedAccountId, string accountDasAccountName) { return(new Email { SystemId = "x", Subject = "x", ReplyToAddress = "*****@*****.**", TemplateId = "SendingEmployerTransferRequestNotification", RecipientsAddress = recipient.Email, Tokens = new Dictionary <string, string> { { "cohort_reference", transferRequest.CohortReference }, { "receiver_name", transferRequest.ReceivingLegalEntityName }, { "transfers_dashboard_url", $"accounts/{accountHashedAccountId}/transfers" } } }); }
public void Arrange() { _db = new Mock <EmployerAccountsDbContext>(); _employerCommitmentApi = new Mock <IEmployerCommitmentApi>(); _hashingService = new Mock <IHashingService>(); _account1 = new Account { Id = 111111, HashedId = "ABC123", Name = "Account 1" }; _account2 = new Account { Id = 22222, HashedId = "ZYX987", Name = "Account 2" }; _sentTransferRequest = new TransferRequestSummary { HashedTransferRequestId = "DEF456", HashedSendingEmployerAccountId = _account1.HashedId, HashedReceivingEmployerAccountId = _account2.HashedId, TransferCost = 123.456m }; _receivedTransferRequest = new TransferRequestSummary { HashedTransferRequestId = "GHI789", HashedSendingEmployerAccountId = _account2.HashedId, HashedReceivingEmployerAccountId = _account1.HashedId, TransferCost = 789.012m }; _transferRequests = new List <TransferRequestSummary> { _sentTransferRequest, _receivedTransferRequest }; _accounts = new List <Account> { _account1, _account2 }; _accountsDbSet = new DbSetStub <Account>(_accounts); _configurationProvider = new MapperConfiguration(c => { c.AddProfile <AccountMappings>(); }); _db.Setup(d => d.Accounts).Returns(_accountsDbSet); _employerCommitmentApi.Setup(c => c.GetTransferRequests(_account1.HashedId)).ReturnsAsync(_transferRequests); _hashingService.Setup(h => h.DecodeValue(_account1.HashedId)).Returns(_account1.Id); _hashingService.Setup(h => h.DecodeValue(_account2.HashedId)).Returns(_account2.Id); _hashingService.Setup(h => h.HashValue(_account1.Id)).Returns(_account1.HashedId); _hashingService.Setup(h => h.HashValue(_account2.Id)).Returns(_account2.HashedId); _handler = new GetTransferRequestsQueryHandler(new Lazy <EmployerAccountsDbContext>(() => _db.Object), _configurationProvider, _employerCommitmentApi.Object, _hashingService.Object); _query = new GetTransferRequestsQuery { AccountId = _account1.Id }; }