/// <inheritdoc /> public KeysController(IWalletService walletService, IApiKeyService apiKeyService, IClientAccountService clientAccountService, IMapper mapper) { _apiKeyService = apiKeyService ?? throw new ArgumentNullException(nameof(apiKeyService)); _walletService = walletService ?? throw new ArgumentNullException(nameof(walletService)); _clientAccountService = clientAccountService ?? throw new ArgumentNullException(nameof(clientAccountService)); _mapper = mapper; }
public void SetUp() { _clientAccountsService = Mock.Of <IClientAccountService>(r => r.GetMarginEnabledAsync("id of client") == Task.FromResult(new MarginEnabledSettingsModel())); var publisher = Mock.Of <IMessageProducer <MarginTradingEnabledChangedMessage> >(); Mock.Get(publisher) .Setup(s => s.ProduceAsync(It.IsNotNull <MarginTradingEnabledChangedMessage>())) .Returns(Task.CompletedTask).Callback <MarginTradingEnabledChangedMessage>(m => _sentMessage = m); var expectedRabbitMqSettings = new RabbitMqSettings { ConnectionString = "conn str", ExchangeName = "exchange name" }; var rabbitMqService = Mock.Of <IRabbitMqService>(s => s.GetProducer(expectedRabbitMqSettings.Equivalent(), true, s.GetJsonSerializer <MarginTradingEnabledChangedMessage>()) == publisher); _marginSettings = new MarginTradingSettings { MtRabbitMqConnString = "conn str", RabbitMqQueues = new RabbitMqQueues { MarginTradingEnabledChanged = new RabbitMqQueueInfo { ExchangeName = "exchange name" } } }; _marginTradingSettingsCacheService = Mock.Of <IMarginTradingSettingsCacheService>(); _sut = new MarginTradingEnablingService(_clientAccountsService, rabbitMqService, _marginSettings, _marginTradingSettingsCacheService); _sut.Start(); }
public OvernightSwapNotificationService( IOvernightSwapCache overnightSwapCache, IAssetPairsCache assetPairsCache, IAccountsCacheService accountsCacheService, IEmailService emailService, IClientAccountService clientAccountService, IDateService dateService, IOvernightSwapHistoryRepository overnightSwapHistoryRepository, IThreadSwitcher threadSwitcher, ILog log) { _overnightSwapCache = overnightSwapCache; _assetPairsCache = assetPairsCache; _accountsCacheService = accountsCacheService; _emailService = emailService; _clientAccountService = clientAccountService; _dateService = dateService; _overnightSwapHistoryRepository = overnightSwapHistoryRepository; _threadSwitcher = threadSwitcher; _log = log; }
public MarginTradingEnabledCacheService(ICacheProvider cacheProvider, IClientAccountService clientAccountService, IAccountsCacheService accountsCacheService) { _cacheProvider = cacheProvider; _clientAccountService = clientAccountService; _accountsCacheService = accountsCacheService; }
public PaidFeeProcessor(IPaidFeeRepository paidFeeRepository, IBonusAccrualRepository bonusAccrualRepository, IMemoryCache memoryCache, IClientAccountService clientAccountService) { _paidFeeRepository = paidFeeRepository; _bonusAccrualRepository = bonusAccrualRepository; _memoryCache = memoryCache; _clientAccountService = clientAccountService; }
public AffiliateController(IReferralRepository referralRepository, IMapper mapper, ILinkService linkService, IClientAccountService clientAccountService, IAccrualService accrualService) { _referralRepository = referralRepository; _mapper = mapper; _linkService = linkService; _clientAccountService = clientAccountService; _accrualService = accrualService; }
public MarginTradingEnablingService(IClientAccountService clientAccountService, IRabbitMqService rabbitMqService, MarginTradingSettings settings, IMarginTradingSettingsCacheService marginTradingSettingsCacheService) { _marginSettings = settings; _rabbitMqService = rabbitMqService; _clientAccountService = clientAccountService; _marginTradingSettingsCacheService = marginTradingSettingsCacheService; }
public NotificationSenderBase( IAppNotifications appNotifications, IClientAccountService clientAccountService, IAssetsCache assetsCache) { _appNotifications = appNotifications; _clientAccountService = clientAccountService; _assetsCache = assetsCache; }
/// <inheritdoc /> public KeysController(IWalletService walletService, IApiKeyService apiKeyService, IClientAccountService clientAccountService, [NotNull] IMapper mapper, ILogFactory logFactory) { _log = logFactory.CreateLog(this); _apiKeyService = apiKeyService ?? throw new ArgumentNullException(nameof(apiKeyService)); _walletService = walletService ?? throw new ArgumentNullException(nameof(walletService)); _clientAccountService = clientAccountService ?? throw new ArgumentNullException(nameof(clientAccountService)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public void Initialize() { var context = new DbContext(); var accountAssetRepository = new MockAccountAssetRepository(context); var assetHolderRepository = new MockAssetHolderRepository(context); var clientAccountRepository = new MockClientAccountRepository(context); var clientRepository = new MockClientRepository(context); _accountAssetService = new AccountAssetService(accountAssetRepository); _assetHolderService = new AssetHolderService(assetHolderRepository); _clientAccountService = new ClientAccountService(clientAccountRepository); _clientService = new ClientService(clientRepository); }
public MarginCallConsumer(IThreadSwitcher threadSwitcher, IEmailService emailService, IClientAccountService clientAccountService, IOperationsLogService operationsLogService, MarginTradingSettings settings, IRabbitMqNotifyService rabbitMqNotifyService, IDateService dateService) { _threadSwitcher = threadSwitcher; _emailService = emailService; _clientAccountService = clientAccountService; _operationsLogService = operationsLogService; _settings = settings; _rabbitMqNotifyService = rabbitMqNotifyService; _dateService = dateService; }
public MarginCallConsumer(IThreadSwitcher threadSwitcher, IAppNotifications appNotifications, IEmailService emailService, IClientAccountService clientAccountService, IMarginTradingOperationsLogService operationsLogService, IRabbitMqNotifyService rabbitMqNotifyService, IDateService dateService, IAssetsCache assetsCache) : base(appNotifications, clientAccountService, assetsCache) { _threadSwitcher = threadSwitcher; _emailService = emailService; _clientAccountService = clientAccountService; _operationsLogService = operationsLogService; _rabbitMqNotifyService = rabbitMqNotifyService; _dateService = dateService; }
public OrderStateConsumer(IThreadSwitcher threadSwitcher, IClientNotifyService clientNotifyService, IAccountsCacheService accountsCacheService, IAppNotifications appNotifications, IClientAccountService clientAccountService, AccountManager accountManager, IRabbitMqNotifyService rabbitMqNotifyService, IAssetsCache assetsCache) : base(appNotifications, clientAccountService, assetsCache) { _threadSwitcher = threadSwitcher; _clientNotifyService = clientNotifyService; _accountsCacheService = accountsCacheService; _accountManager = accountManager; _rabbitMqNotifyService = rabbitMqNotifyService; }
public RabbitMqHandler( IWampHostedRealm realm, IClientAccountService clientNotificationService, IMarginTradingOperationsLogService operationsLogService, MtFrontendSettings settings, IConsole consoleWriter, ILog log, IMarginTradingSettingsCacheService marginTradingSettingsCacheService) { _realm = realm; _clientNotificationService = clientNotificationService; _operationsLog = operationsLogService; _settings = settings; _consoleWriter = consoleWriter; _log = log; _marginTradingSettingsCacheService = marginTradingSettingsCacheService; _allPairsSubject = realm.Services.GetSubject <BidAskPairRabbitMqContract>(WampConstants.PricesTopicPrefix); _tradesSubject = realm.Services.GetSubject <TradeClientContract>(WampConstants.TradesTopic); }
/// <summary> /// Creates a new instance of the Rezervation service. /// </summary> /// <param name="context"></param> /// <param name="clientAccountService"></param> public RezervationService(CarRentalDbContext context, IClientAccountService clientAccountService) { this.dbContext = context; this.clientAccountService = clientAccountService; }
public WalletService(IApiKeyService apiKeyService, IClientAccountService clientAccountService) { _clientAccountService = clientAccountService ?? throw new ArgumentNullException(nameof(clientAccountService)); _apiKeyService = apiKeyService ?? throw new ArgumentNullException(nameof(apiKeyService)); }
/// <summary> /// Creates new instance of the client account controller. /// </summary> /// <param name="clientAccountService"></param> public ClientAccountController(IClientAccountService clientAccountService) => this.clientAccountService = clientAccountService;
public UserController(IClientAccountService clientNotificationService) { _clientNotificationService = clientNotificationService; }
public EmailService(ITemplateGenerator templateGenerator, IEmailSender emailSender, IClientAccountService clientAccountService) { _templateGenerator = templateGenerator; _emailSender = emailSender; _clientAccountService = clientAccountService; }