Beispiel #1
0
        public virtual void Init(IActorRef notifyActor)
        {
            var autoTestGridDomainConfiguration = new AutoTestLocalDbConfiguration();

            TestDbTools.ClearData(autoTestGridDomainConfiguration);

            var system    = CreateSystem(AkkaConfig);
            var container = new UnityContainer();

            system.AddDependencyResolver(new UnityDependencyResolver(container, system));

            InitContainer(container, notifyActor);
            var routingActor = CreateRoutingActor(system);

            Router = new ActorMessagesRouter(routingActor);
        }
        internal override void OnSetup()
        {
            var readDb = new AutoTestLocalDbConfiguration();

            DbContextOptions = new DbContextOptionsBuilder <BalloonContext>().UseSqlServer(readDb.ReadModelConnectionString)
                               .Options;
            using (var ctx = new BalloonContext(DbContextOptions))
            {
                ctx.Database.EnsureDeleted();
                ctx.Database.EnsureCreated();
                ctx.BalloonCatalog.Add(new BalloonCatalogItem()
                {
                    BalloonId = Guid.NewGuid()
                                .ToString(),
                    LastChanged = DateTime.UtcNow,
                    Title       = "WarmUp"
                });
                ctx.SaveChanges();
            }

            base.OnSetup();
        }