public KeySagaLocatorTests() { sagaRegistry = Substitute.For <ISagaRegistry>(); sagaMetadataRepository = Substitute.For <ISagaMetadataRepository>(); sut = new KeySagaLocator(sagaRegistry, sagaMetadataRepository); }
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)); }
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); }
public KeySagaLocator(ISagaRegistry sagaRegistry, ISagaMetadataRepository sagaMetadataRepository) { this.sagaRegistry = sagaRegistry; this.sagaMetadataRepository = sagaMetadataRepository; }