public void Setup() { var fixture = new Fixture(); _withdrawCommand = fixture.Build <WithdrawCommand>() .FromFactory(() => new WithdrawCommand(1, CurrencySettings.DefaultCurrencyKey)) .Create(); _withdrawCommandWithHugeMoney = fixture.Build <WithdrawCommand>() .FromFactory(() => new WithdrawCommand(1000, CurrencySettings.DefaultCurrencyKey)) .Create(); _currencies = fixture.Build <Currency>() .FromFactory(() => new Currency("PHP", 1, "en-PH")) .CreateMany(5); _wallets = fixture.Build <Wallet>() .CreateMany(1); _walletsWithSmallBalance = fixture.Build <Wallet>() .FromFactory(() => new Wallet(1, new WalletId(Guid.NewGuid()), new Money(10), 1)) .CreateMany(1); _target = new WithdrawCommandHandler(_walletRepositoryMock.Object, _currencyRepositoryMock.Object, _authenticationServiceMock.Object); }
public void Arrange() { _fixture = new Fixture(); _mockIncentiveDomainRepository = new Mock <IApprenticeshipIncentiveDomainRepository>(); _mockCollectionCalendarService = new Mock <ICollectionCalendarService>(); _activePeriod = new Domain.ValueObjects.CollectionPeriod(2, 2020); _activePeriod.SetActive(true); var collectionPeriods = new List <Domain.ValueObjects.CollectionPeriod>() { new Domain.ValueObjects.CollectionPeriod(1, 2020), _activePeriod, new Domain.ValueObjects.CollectionPeriod(3, 2020) }; _mockCollectionCalendarService.Setup(m => m.Get()).ReturnsAsync(new Domain.ValueObjects.CollectionCalendar(collectionPeriods)); _fixture.Register(ApprenticeshipIncentiveCreator); _sut = new WithdrawCommandHandler(_mockIncentiveDomainRepository.Object, _mockCollectionCalendarService.Object); }
public void Setup() { context = BankingContext.Create(); handler = new WithdrawCommandHandler(currencyService, context, dateTime); _accountRepository = new AccountRepository(context, dateTime); }