Example #1
0
        public void CanCreateInstance()
        {
            var testee = new EventStoreFactory();

            testee.Create(A.Fake <AbstractEventStoreConfiguration>(), A.Fake <IDeliverMessages>())
            .Should().BeAssignableTo <InMemoryEventStore>();
        }
Example #2
0
        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>();
        }