public void SetUp()
        {
            eventStoreDbTest = new EventStoreDbTest();
            clockName = Any.CamelCaseName();

            Clock.Reset();

            disposables = new CompositeDisposable
            {
                Disposable.Create(() => eventStoreDbTest.TearDown()),
                Disposable.Create(Clock.Reset)
            };

            var bus = new FakeEventBus();
            orderRepository = new SqlEventSourcedRepository<Order>(bus);
            accountRepository = new SqlEventSourcedRepository<CustomerAccount>(bus);

            var configuration = new Configuration();
            configuration.UseEventBus(bus)
                         .UseDependency<IEventSourcedRepository<Order>>(t => orderRepository)
                         .UseDependency<IEventSourcedRepository<CustomerAccount>>(t => accountRepository);

            ConfigureScheduler(configuration);

            disposables.Add(ConfigurationContext.Establish(configuration));

            Console.WriteLine(new { clockName });

            clockTrigger = configuration.Container.Resolve<ISchedulerClockTrigger>();
            clockRepository = configuration.Container.Resolve<ISchedulerClockRepository>();
            clockRepository.CreateClock(clockName, Clock.Now());
        }
예제 #2
0
 public override void SetUp()
 {
     base.SetUp();
     eventStoreDbTest = new EventStoreDbTest();
     eventStoreDbTest.SetUp();
     RegisterForDisposal(Disposable.Create(() => eventStoreDbTest.TearDown()));
 }
 public override void SetUp()
 {
     base.SetUp();
     eventStoreDbTest = new EventStoreDbTest();
     eventStoreDbTest.SetUp();
     RegisterForDisposal(Disposable.Create(() => eventStoreDbTest.TearDown()));
 }
        public void SetUp()
        {
            disposables = new CompositeDisposable();

            Command <Order> .AuthorizeDefault = (order, command) => true;
            EventStoreDbTest.SetConnectionStrings();
            configuration = GetConfiguration();
            disposables.Add(ConfigurationContext.Establish(configuration));
        }
        protected override void Configure(
            Configuration configuration,
            Action<IDisposable> onDispose)
        {
            eventStoreDbTest = new EventStoreDbTest();
            clockName = Any.CamelCaseName();

            configuration
                .UseDependency<GetClockName>(c => e => clockName)
                .UseSqlEventStore()
                .UseSqlStorageForScheduledCommands();
        }
        public void SetUp()
        {
            eventStoreDbTest = new EventStoreDbTest();
            clockName = Any.CamelCaseName();

            VirtualClock.Start();

            disposables = new CompositeDisposable
            {
                Disposable.Create(() => eventStoreDbTest.TearDown())
            };

            var configuration = new Configuration();

            Configure(configuration);

            disposables.Add(ConfigurationContext.Establish(configuration));
        }