/// <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();
        }
Пример #3
0
        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;
 }
Пример #6
0
 public AffiliateController(IReferralRepository referralRepository, IMapper mapper, ILinkService linkService, IClientAccountService clientAccountService, IAccrualService accrualService)
 {
     _referralRepository   = referralRepository;
     _mapper               = mapper;
     _linkService          = linkService;
     _clientAccountService = clientAccountService;
     _accrualService       = accrualService;
 }
Пример #7
0
 public MarginTradingEnablingService(IClientAccountService clientAccountService, IRabbitMqService rabbitMqService,
                                     MarginTradingSettings settings,
                                     IMarginTradingSettingsCacheService marginTradingSettingsCacheService)
 {
     _marginSettings       = settings;
     _rabbitMqService      = rabbitMqService;
     _clientAccountService = clientAccountService;
     _marginTradingSettingsCacheService = marginTradingSettingsCacheService;
 }
Пример #8
0
 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));
 }
Пример #10
0
        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);
        }
Пример #11
0
 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;
 }
Пример #12
0
 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;
 }
Пример #13
0
 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;
 }
Пример #14
0
 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);
 }
Пример #15
0
 /// <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;
 }
Пример #16
0
 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;
Пример #18
0
 public UserController(IClientAccountService clientNotificationService)
 {
     _clientNotificationService = clientNotificationService;
 }
Пример #19
0
 public EmailService(ITemplateGenerator templateGenerator, IEmailSender emailSender, IClientAccountService clientAccountService)
 {
     _templateGenerator    = templateGenerator;
     _emailSender          = emailSender;
     _clientAccountService = clientAccountService;
 }