public async Task GivenAMongoDbQuerySagaRepository_WhenFindingSaga()
        {
            _correlationId = Guid.NewGuid();

            await SagaRepository.InsertSaga(new SimpleSaga { CorrelationId = _correlationId });

            var repository = new MongoDbQuerySagaRepository <SimpleSaga>(SagaRepository.Instance);

            ISagaQuery <SimpleSaga> query = new SagaQuery <SimpleSaga>(x => x.CorrelationId == _correlationId);

            _result = await repository.Find(query);
        }
        public void GivenAMongoDbQuerySagaRepository_WhenFindingSaga()
        {
            _correlationId = Guid.NewGuid();

            SagaRepository.InsertSaga(new SimpleSaga {CorrelationId = _correlationId}).GetAwaiter().GetResult();

            var repository = new MongoDbQuerySagaRepository<SimpleSaga>(SagaRepository.Instance);

            ISagaQuery<SimpleSaga> query = new SagaQuery<SimpleSaga>(x => x.CorrelationId == _correlationId);

            _result = repository.Find(query).GetAwaiter().GetResult();
        }
Ejemplo n.º 3
0
        public void GivenAMongoDbQuerySagaRepository_WhenFindingSaga()
        {
            _correlationId = Guid.NewGuid();

            SagaRepository.InsertSaga(new SimpleSaga {
                CorrelationId = _correlationId
            }).GetAwaiter().GetResult();

            var repository = new MongoDbQuerySagaRepository <SimpleSaga>(SagaRepository.Instance);

            ISagaQuery <SimpleSaga> query = new SagaQuery <SimpleSaga>(x => x.CorrelationId == _correlationId);

            _result = repository.Find(query).GetAwaiter().GetResult();
        }
        public async Task GivenAMongoDbQuerySagaRepository_WhenFindingSaga()
        {
            _correlationId = Guid.NewGuid();

            await SagaRepository.InsertSaga(new SimpleSaga()
            {
                CorrelationId = _correlationId
            });

            var repository = new MongoDbQuerySagaRepository <SimpleSaga>(SagaRepository.Instance);

            var sagaQuery = new Mock <ISagaQuery <SimpleSaga> >();

            sagaQuery.Setup(m => m.FilterExpression).Returns(x => x.CorrelationId == _correlationId);

            _result = await repository.Find(sagaQuery.Object);
        }