public AzureEventSourcedRepository( IAzureEventStore eventStore, IAzureEventPublisher eventPublisher, Func <Guid, IEnumerable <IDomainEvent>, T> entityFactory) { _eventStore = eventStore ?? throw new ArgumentNullException(nameof(eventStore)); _eventPublisher = eventPublisher ?? throw new ArgumentNullException(nameof(eventPublisher)); _entityFactory = entityFactory ?? throw new ArgumentNullException(nameof(entityFactory)); }
public AzureEventSourcedRepository( IAzureEventStore eventStore, IAzureEventPublisher eventPublisher, IMementoStore mementoStore, Func <Guid, IEnumerable <IDomainEvent>, T> entityFactory, Func <Guid, IMemento, IEnumerable <IDomainEvent>, T> mementoEntityFactory) : this(eventStore, eventPublisher, entityFactory) { _mementoStore = mementoStore ?? throw new ArgumentNullException(nameof(mementoStore)); _mementoEntityFactory = mementoEntityFactory ?? throw new ArgumentNullException(nameof(mementoEntityFactory)); }
public void constructor_sets_EventPublisher_correctly() { IAzureEventPublisher eventPublisher = Mock.Of <IAzureEventPublisher>(); var sut = new AzureEventSourcedRepository <FakeUser>( Mock.Of <IAzureEventStore>(), eventPublisher, FakeUser.Factory); sut.EventPublisher.Should().BeSameAs(eventPublisher); }
public void TestInitialize() { fixture = new Fixture().Customize(new AutoMoqCustomization()); eventStore = Mock.Of <IAzureEventStore>(); eventPublisher = Mock.Of <IAzureEventPublisher>(); mementoStore = Mock.Of <IMementoStore>(); sut = new AzureEventSourcedRepository <FakeUser>( eventStore, eventPublisher, mementoStore, FakeUser.Factory, FakeUser.Factory); }