示例#1
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;
        }
示例#2
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);
            }
        }
示例#3
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);
            }
        }