Beispiel #1
0
        public MultiTestConsumer(TimeSpan timeout)
        {
            Timeout     = timeout;
            _configures = new List <IConsumerConfigurator>();

            _received = new ReceivedMessageList(timeout);
        }
        public HandlerTestHarness(BusTestHarness testHarness, MessageHandler <TMessage> handler)
        {
            _handler = handler;

            _consumed = new ReceivedMessageList <TMessage>(testHarness.TestTimeout, testHarness.InactivityToken);

            testHarness.OnConfigureReceiveEndpoint += ConfigureReceiveEndpoint;
        }
Beispiel #3
0
        public SagaTestHarnessRegistration(BusTestHarness testHarness)
        {
            TestTimeout = testHarness.TestTimeout;

            Consumed = new ReceivedMessageList(testHarness.TestTimeout, testHarness.InactivityToken);
            Created  = new SagaList <TSaga>(testHarness.TestTimeout, testHarness.InactivityToken);
            Sagas    = new SagaList <TSaga>(testHarness.TestTimeout, testHarness.InactivityToken);
        }
Beispiel #4
0
        public MultiTestConsumer(TimeSpan timeout, CancellationToken testCompleted = default)
        {
            _testCompleted = testCompleted;
            Timeout        = timeout;
            _configures    = new List <IConsumerConfigurator>();

            _received = new ReceivedMessageList(timeout, testCompleted);
        }
        public ConsumerTestHarness(BusTestHarness testHarness, IConsumerFactory <TConsumer> consumerFactory)
        {
            _consumerFactory = consumerFactory;

            _consumed = new ReceivedMessageList(testHarness.TestTimeout);

            testHarness.OnConfigureReceiveEndpoint += ConfigureReceiveEndpoint;
        }
Beispiel #6
0
        public ConsumerTestHarness(BusTestHarness testHarness, IConsumerFactory <TConsumer> consumerFactory, string queueName)
        {
            _consumerFactory = consumerFactory;

            _consumed = new ReceivedMessageList(testHarness.TestTimeout, testHarness.InactivityToken);

            if (string.IsNullOrWhiteSpace(queueName))
            {
                testHarness.OnConfigureReceiveEndpoint += ConfigureReceiveEndpoint;
            }
            else
            {
                testHarness.OnConfigureBus += configurator => ConfigureNamedReceiveEndpoint(configurator, queueName);
            }
        }
Beispiel #7
0
        public SagaTestHarness(BusTestHarness testHarness, ISagaRepository <TSaga> repository)
        {
            _repository          = repository;
            _querySagaRepository = _repository as IQuerySagaRepository <TSaga>;

            _testTimeout = testHarness.TestTimeout;

            _consumed = new ReceivedMessageList(testHarness.TestTimeout);
            _created  = new SagaList <TSaga>(testHarness.TestTimeout);
            _sagas    = new SagaList <TSaga>(testHarness.TestTimeout);

            TestRepository = new TestSagaRepositoryDecorator <TSaga>(_repository, _consumed, _created, _sagas);

            testHarness.OnConfigureReceiveEndpoint += ConfigureReceiveEndpoint;
        }
Beispiel #8
0
        public SagaTestHarness(BusTestHarness testHarness, ISagaRepository <TSaga> repository, string queueName)
            : base(repository, testHarness.TestTimeout)
        {
            _consumed = new ReceivedMessageList(testHarness.TestTimeout, testHarness.InactivityToken);
            _created  = new SagaList <TSaga>(testHarness.TestTimeout, testHarness.InactivityToken);
            _sagas    = new SagaList <TSaga>(testHarness.TestTimeout, testHarness.InactivityToken);

            TestRepository = new TestSagaRepositoryDecorator <TSaga>(repository, _consumed, _created, _sagas);

            if (string.IsNullOrWhiteSpace(queueName))
            {
                testHarness.OnConfigureReceiveEndpoint += ConfigureReceiveEndpoint;
            }
            else
            {
                testHarness.OnConfigureBus += configurator => ConfigureNamedReceiveEndpoint(configurator, queueName);
            }
        }
Beispiel #9
0
        public SagaTestHarness(BusTestHarness testHarness, ISagaRepository <TSaga> repository, string queueName)
        {
            _repository          = repository;
            _querySagaRepository = _repository as IQuerySagaRepository <TSaga>;

            _testTimeout = testHarness.TestTimeout;

            _consumed = new ReceivedMessageList(testHarness.TestTimeout);
            _created  = new SagaList <TSaga>(testHarness.TestTimeout);
            _sagas    = new SagaList <TSaga>(testHarness.TestTimeout);

            TestRepository = new TestSagaRepositoryDecorator <TSaga>(_repository, _consumed, _created, _sagas);

            if (string.IsNullOrWhiteSpace(queueName))
            {
                testHarness.OnConfigureReceiveEndpoint += ConfigureReceiveEndpoint;
            }
            else
            {
                testHarness.OnConfigureBus += configurator => ConfigureNamedReceiveEndpoint(configurator, queueName);
            }
        }
        public ConsumerTestHarness(BusTestHarness testHarness, IConsumerFactory <TConsumer> consumerFactory)
        {
            _consumerFactory = consumerFactory;

            _consumed = new ReceivedMessageList(testHarness.TestTimeout, testHarness.InactivityToken);
        }
Beispiel #11
0
 public FaultOf(MultiTestConsumer multiConsumer)
 {
     _multiConsumer = multiConsumer;
     _received      = new ReceivedMessageList <T>(multiConsumer.Timeout);
 }
Beispiel #12
0
 public RegistrationConsumerTestHarness(ConsumerTestHarnessRegistration <TConsumer> registration)
 {
     _consumed = registration.Consumed;
 }
Beispiel #13
0
 public ConsumerTestHarnessRegistration(BusTestHarness testHarness)
 {
     Consumed = new ReceivedMessageList(testHarness.TestTimeout, testHarness.InactivityToken);
 }
Beispiel #14
0
 public FaultOf(MultiTestConsumer multiConsumer)
 {
     _multiConsumer = multiConsumer;
     Received       = new ReceivedMessageList <T>(multiConsumer.Timeout, multiConsumer._testCompleted);
 }