public void Run(EventStoreOption eventStoreOption)
        {
            var commandProcessor = GetCommandProcessor(eventStoreOption);

            var result = commandProcessor.ProcessCommand(new SomeCommand { SomeId = "somekey" });

            Assert.That(result.EventsWereEmitted, Is.False);
        }
Example #2
0
        //[TestCase(EventStoreOption.Postgres)]
        public void Run(EventStoreOption eventStoreOption)
        {
            var commandProcessor = GetCommandProcessor(eventStoreOption);

            var result = commandProcessor.ProcessCommand(new SomeCommand {
                SomeId = "somekey"
            });

            Assert.That(result.EventsWereEmitted, Is.False);
        }
Example #3
0
        protected ICommandProcessor GetCommandProcessor(EventStoreOption eventStoreOption)
        {
            var eventStore = GetEventStore(eventStoreOption);

            var commandProcessor = CommandProcessor.With()
                .EventStore(e => e.RegisterInstance(eventStore))
                .EventDispatcher(e => e.UseConsoleOutEventDispatcher())
                .Create();

            RegisterForDisposal(commandProcessor);

            return commandProcessor;
        }
Example #4
0
        protected ICommandProcessor GetCommandProcessor(EventStoreOption eventStoreOption)
        {
            var eventStore = GetEventStore(eventStoreOption);

            var commandProcessor = CommandProcessor.With()
                                   .EventStore(e => e.RegisterInstance(eventStore))
                                   .EventDispatcher(e => e.UseConsoleOutEventDispatcher())
                                   .Create();

            RegisterForDisposal(commandProcessor);

            return(commandProcessor);
        }
Example #5
0
        protected ICommandProcessor GetCommandProcessor(EventStoreOption eventStoreOption)
        {
            var eventStore = GetEventStore(eventStoreOption);

            //Brett
            var commandProcessor = base.CreateCommandProcessor(config => config
                                                               .EventStore(e => e.RegisterInstance(eventStore))
                                                               .EventDispatcher(e => e.UseConsoleOutEventDispatcher()));

            //Orig
            //var commandProcessor = CommandProcessor.With()
            //    .EventStore(e => e.RegisterInstance(eventStore))
            //    .EventDispatcher(e => e.UseConsoleOutEventDispatcher())
            //    .Create();

            RegisterForDisposal(commandProcessor);

            return(commandProcessor);
        }
Example #6
0
        IEventStore GetEventStore(EventStoreOption eventStoreOption)
        {
            switch (eventStoreOption)
            {
                case EventStoreOption.InMemory:
                    return new InMemoryEventStore();

                case EventStoreOption.MongoDb:
                    return new MongoDbEventStore(GetMongoDb(), "Events");

                case EventStoreOption.SqlServer:
                    MsSqlTestHelper.EnsureTestDatabaseExists();
                    MsSqlTestHelper.DropTable("Events");
                    return new MsSqlEventStore(MsSqlTestHelper.ConnectionString, "Events");

                case EventStoreOption.Postgres:
                    PostgreSqlTestHelper.DropTable("Events");
                    return new PostgreSqlEventStore(PostgreSqlTestHelper.PostgreSqlConnectionString, "Events");

                default:
                    throw new ArgumentOutOfRangeException("eventStoreOption", "Unknown event store option");
            }
        }
Example #7
0
        IEventStore GetEventStore(EventStoreOption eventStoreOption)
        {
            switch (eventStoreOption)
            {
            case EventStoreOption.InMemory:
                return(new InMemoryEventStore());

            case EventStoreOption.MongoDb:
                return(new MongoDbEventStore(GetMongoDb(), "Events"));

            case EventStoreOption.SqlServer:
                MsSqlTestHelper.EnsureTestDatabaseExists();
                MsSqlTestHelper.DropTable("Events");
                return(new MsSqlEventStore(Configuration.Get(), MsSqlTestHelper.ConnectionString, "Events"));

            case EventStoreOption.Postgres:
                PostgreSqlTestHelper.DropTable("Events");
                return(new PostgreSqlEventStore(Configuration.Get(), PostgreSqlTestHelper.PostgreSqlConnectionString, "Events"));

            default:
                throw new ArgumentOutOfRangeException("eventStoreOption", "Unknown event store option");
            }
        }