Exemplo n.º 1
0
        public void OneTimeSetUp()
        {
            var sett             = SettingsUtil.Settings.IntegrationTestSettings;
            var connectionString = sett.Cqrs.ConnectionString;
            var eventsExchange   = $"{sett.Cqrs.EnvironmentName}.{sett.Cqrs.ContextNames.AccountsManagement}.events.exchange";

            //cqrs messages subscription
            RabbitUtil.ListenCqrsMessages <AccountChangedEvent>(connectionString, eventsExchange);

            //other messages subscription
            RabbitUtil.ListenJsonMessages <OrderHistoryEvent>(connectionString, sett.RabbitMqQueues.OrderHistory.ExchangeName);

            // RabbitMqSubscriber does not wait for a reader thread to start before returning from the Start() method
            Thread.Sleep(sett.MessagingDelay);
        }
Exemplo n.º 2
0
        public void RunBeforeAnyTests()
        {
            var sett             = SettingsUtil.Settings.MarginTradingAccountManagement.Cqrs;
            var connectionString = sett.ConnectionString;
            var eventsExchange   = $"{sett.EnvironmentName}.{sett.ContextNames.AccountsManagement}.events.exchange";

            RabbitUtil.ListenCqrsMessages <AccountBalanceChangedEvent>(connectionString, eventsExchange);
            RabbitUtil.ListenCqrsMessages <DepositSucceededEvent>(connectionString, eventsExchange);
            RabbitUtil.ListenCqrsMessages <WithdrawalSucceededEvent>(connectionString, eventsExchange);
            RabbitUtil.ListenCqrsMessages <WithdrawalFailedEvent>(connectionString, eventsExchange);

            // todo: register other messages

            // RabbitMqSubscriber does not wait for a reader thread to start before returning from the Start() method
            Thread.Sleep(500);
        }