Пример #1
0
 private static void SetupAllFactories(
     TransactionsExecutorServiceOptions <AppSettings> options,
     MockAggregator aggregator)
 {
     SetupCommonFactories(options, aggregator);
     SetupTransferCoinsModelFactories(options, aggregator);
 }
Пример #2
0
        private static MockAggregator CreateMocks()
        {
            var aggregator = new MockAggregator
            {
                AddressValidator                   = new Mock <IAddressValidator>(),
                HealthProvider                     = new Mock <IHealthProvider>(),
                BlockchainInfoProvider             = new Mock <IBlockchainInfoProvider>(),
                DependenciesInfoProvider           = new Mock <IDependenciesInfoProvider>(),
                TransactionEstimator               = new Mock <ITransferAmountTransactionsEstimator>(),
                TransactionBroadcaster             = new Mock <ITransactionBroadcaster>(),
                TransferAmountTransactionBuilder   = new Mock <ITransferAmountTransactionsBuilder>(),
                AddressFormatsProvider             = new Mock <IAddressFormatsProvider>(),
                TransactionStateProvider           = new Mock <ITransactionsStateProvider>(),
                TransferCoinsTransactionsBuilder   = new Mock <ITransferCoinsTransactionsBuilder>(),
                TransferCoinsTransactionsEstimator = new Mock <ITransferCoinsTransactionsEstimator>()
            };

            return(aggregator);
        }
Пример #3
0
 private static void SetupCommonFactories(TransactionsExecutorServiceOptions <AppSettings> options, MockAggregator aggregator)
 {
     options.AddressFormatsProviderFactory              = c => aggregator.AddressFormatsProvider.Object;
     options.AddressValidatorFactory                    = c => aggregator.AddressValidator.Object;
     options.HealthProviderFactory                      = c => aggregator.HealthProvider.Object;
     options.BlockchainInfoProviderFactory              = c => aggregator.BlockchainInfoProvider.Object;
     options.DependenciesInfoProviderFactory            = c => aggregator.DependenciesInfoProvider.Object;
     options.TransferAmountTransactionsEstimatorFactory = c => aggregator.TransactionEstimator.Object;
     options.TransactionBroadcasterFactory              = c => aggregator.TransactionBroadcaster.Object;
     options.TransferAmountTransactionsBuilderFactory   = c => aggregator.TransferAmountTransactionBuilder.Object;
     options.TransactionsStateProviderFactory           = c => aggregator.TransactionStateProvider.Object;
     options.DisableLogging = true;
 }
Пример #4
0
 private static void SetupTransferCoinsModelFactories(TransactionsExecutorServiceOptions <AppSettings> options,
                                                      MockAggregator aggregator)
 {
     options.TransferCoinsTransactionsBuilderFactory   = c => aggregator.TransferCoinsTransactionsBuilder.Object;
     options.TransferCoinsTransactionsEstimatorFactory = c => aggregator.TransferCoinsTransactionsEstimator.Object;
 }