예제 #1
0
        protected override void SetUp()
        {
            IdGenerator = new IdGenerator("my-root");

            var containerBuilder = new ContainerBuilder();

            containerBuilder.RegisterModule <EventSourcingCoreModule>();
            containerBuilder.RegisterModule <HandlerModule>();
            containerBuilder.RegisterEventStorePersistenceModule(_testFixtureOptions["EventStorePersistence"]);
            containerBuilder.RegisterModule <TestSetupModule>();

            containerBuilder.RegisterType <Calculator>().As <ICalculator>();
            containerBuilder.RegisterType <AccountAggregateRoot>();

            var container = containerBuilder.Build();

            Subject          = container.Resolve <IBus>();
            Repository       = container.Resolve <INaturalKeyDrivenAggregateRepository <AccountAggregateRoot, Guid, string> >();
            BalanceReadModel = container.Resolve <BalanceReadModel>();

            AccountId = IdGenerator.CreateAggregateId();
        }