예제 #1
0
        public KeySagaLocatorTests()
        {
            sagaRegistry           = Substitute.For <ISagaRegistry>();
            sagaMetadataRepository = Substitute.For <ISagaMetadataRepository>();

            sut = new KeySagaLocator(sagaRegistry, sagaMetadataRepository);
        }
예제 #2
0
        public SagaRepository(ICommandBus commandBus,
                              IRepository repository,
                              ISagaMetadataRepository metadataRepository,
                              IEntityTypeManager entityTypeManager,
                              IUnitOfWork unitOfWork)
        {
            this.commandBus        = commandBus;
            this.repository        = repository;
            this.entityTypeManager = entityTypeManager;
            MetadataRepository     = metadataRepository;

            unitOfWork.AddInnerTransaction(new SagaRepositoryTransaction(this));
        }
예제 #3
0
        public SagaRepositoryTests()
        {
            unitOfWork = Substitute.For <IUnitOfWork>();
            unitOfWork.When(x => x.AddInnerTransaction(Arg.Any <ITransaction>())).Do(ci => uowInnerTransaction = ci.ArgAt <ITransaction>(0));

            commandBus             = Substitute.For <ICommandBus>();
            sagaMetadataRepository = Substitute.For <ISagaMetadataRepository>();
            entityTypeManager      = Substitute.For <IEntityTypeManager>();
            repository             = Substitute.ForPartsOf <FakeRepository>();
            entityTypeManager      = Substitute.For <IEntityTypeManager>();

            entityTypeManager.GetClassInfoByClassId(saga1ClassId)
            .Returns(new DomainClassInfo(saga1ClassId, null, typeof(Saga1)));

            entityTypeManager.GetClassInfoByClrType(typeof(Saga1))
            .Returns(new DomainClassInfo(saga1ClassId, null, typeof(Saga1)));

            sut = new SagaRepository(commandBus, repository, sagaMetadataRepository, entityTypeManager, unitOfWork);
        }
예제 #4
0
 public KeySagaLocator(ISagaRegistry sagaRegistry, ISagaMetadataRepository sagaMetadataRepository)
 {
     this.sagaRegistry           = sagaRegistry;
     this.sagaMetadataRepository = sagaMetadataRepository;
 }