protected DomainObjectRepositoryBase GetSut(IDomainObjectActivator activator) { return(new FakeRepository(new EventSourceConfiguration() { Activator = activator })); }
public EventsourceDIContext(IDomainObjectActivator domainObjectActivator, IStateActivator stateActivator) { Precondition.For(domainObjectActivator, nameof(domainObjectActivator)).NotNull(); Precondition.For(stateActivator, nameof(stateActivator)).NotNull(); DomainObjectActivator = domainObjectActivator; StateActivator = stateActivator; }
public static EventStoreContext CreateDefault(string prefix, IEventStoreConnection connection, IDomainObjectActivator activator = null) { var namer = new StreamTypeNamer(prefix); var eventSerializer = new JsonEventSerializer(new EventTypeResolver()); var transformer = new EventTransformator(eventSerializer); if (activator == null) { activator = new ActivatorDomainObjectActivator(); } return(new EventStoreContext(connection, namer, new EventStoreReader(connection, transformer), new EventStoreWriter(connection, transformer), activator)); }
private EventStoreContext(IEventStoreConnection connection, IStreamNamer streamNamer, IEventReader reader, IEventWriter writer, IDomainObjectActivator activator) { Precondition.For(connection, nameof(connection)).NotNull(); Precondition.For(streamNamer, nameof(streamNamer)).NotNull(); Precondition.For(reader, nameof(reader)).NotNull(); Precondition.For(writer, nameof(writer)).NotNull(); Precondition.For(activator, nameof(activator)).NotNull(); Connection = connection; Reader = reader; Writer = writer; Activator = activator; StreamNamer = streamNamer; }
protected ResolvingDomainObjectTests() { IDomainObjectActivator sut = GetSut(); domainObject = sut.Resolve <CustomerDomainObject>(customerId); }
private void CreateFakeActivator() { activator = A.Fake <IDomainObjectActivator>(); A.CallTo(() => activator.Resolve(A <Type> .That.IsEqualTo(domainObjectType), A <string> .That.IsEqualTo(id))).Returns(expectedResult); }
protected DomainObjectRepositoryBase GetSut(IDomainObjectActivator activator, IStateActivator stateActivator) { var repo = new FakeRepository(new EventSourceConfiguration(), new EventsourceDIContext(activator, stateActivator)); return(repo); }