public void CanCreateInstance() { var testee = new EventStoreFactory(); testee.Create(A.Fake <AbstractEventStoreConfiguration>(), A.Fake <IDeliverMessages>()) .Should().BeAssignableTo <InMemoryEventStore>(); }
public void CanRegisterEventStoreCreation() { var configuration = A.Fake <AbstractEventStoreConfiguration>(); var testee = new EventStoreFactory(); A.CallTo(() => configuration.Get <DbConnectionFactory>(SqlEventStore.ConnectionFactory)) .Returns(new DbConnectionFactory()); testee.Register(config => new SqlEventStore(config)); testee.Create(configuration, A.Fake <IDeliverMessages>()) .Should().BeAssignableTo <SqlEventStore>(); }
/// <summary> /// Creates a new instance of <see cref="ContainerLessEventStoreConfiguration"/> /// </summary> /// <param name="factory">Dependency injection for <see cref="EventStoreFactory"/></param> public ContainerLessEventStoreConfiguration(EventStoreFactory factory) { this.factory = factory; }