Beispiel #1
0
        public void InitializeServices_WhenServiceLocatorIsNotSet_ThrowsException()
        {
            ServiceLocatorUnitTestHelper.SetThreadLocalServiceLocator(null);
            var root = new SimpleAggregateRoot();

            root.InitializeServices();
        }
Beispiel #2
0
        protected override void OnTeardown()
        {
            base.OnTeardown();

            ServiceLocatorUnitTestHelper.SetThreadLocalServiceLocator(null);
            Container             = null;
            StructureMapContainer = null;
        }
Beispiel #3
0
        protected override void OnSetup()
        {
            base.OnSetup();

            StructureMapContainer = new Container();
            Container             = new IoC.StructureMap.Container(StructureMapContainer);

            StructureMapContainer.Configure(c => c.For <IDomainEventService>().HybridHttpOrThreadLocalScoped().Use <DomainEventService> ());

            ServiceLocatorUnitTestHelper.SetThreadLocalServiceLocator(Container);
        }