public GetAccountPayeSchemesQueryHandler( IPayeSchemesService payeSchemesService, IValidator <GetAccountPayeSchemesQuery> validator) { _validator = validator; _payeSchemesService = payeSchemesService; }
public GetAccountPayeSchemesForAuthorisedUserQueryHandler( IPayeSchemesService payeSchemesService, IValidator <GetAccountPayeSchemesForAuthorisedUserQuery> validator) { _payeSchemesService = payeSchemesService; _validator = validator; }
public void Arrange() { _payeView = new PayeView { AccountId = AccountId, Ref = "123/ABC" }; _englishFraction = new DasEnglishFraction { EmpRef = _payeView.Ref, DateCalculated = UpdateDate, Amount = 0.5m }; _hashedAccountId = "123ABC"; _payeSchemesRepository = new Mock <IPayeRepository>(); _englishFractionsRepository = new Mock <IEnglishFractionRepository>(); _hashingService = new Mock <IHashingService>(); _payeSchemesRepository.Setup(x => x.GetPayeSchemesByAccountId(It.IsAny <long>())).ReturnsAsync(new List <PayeView> { _payeView }); _englishFractionsRepository.Setup(x => x.GetCurrentFractionForSchemes(It.IsAny <long>(), It.IsAny <IEnumerable <string> >())) .ReturnsAsync(new List <DasEnglishFraction> { _englishFraction }); _hashingService.Setup(x => x.DecodeValue(It.IsAny <string>())) .Returns(AccountId); SUT = new PayeSchemesService( _payeSchemesRepository.Object, _englishFractionsRepository.Object, _hashingService.Object); }