public void InitializeServices_WhenServiceLocatorIsNotSet_ThrowsException() { ServiceLocatorUnitTestHelper.SetThreadLocalServiceLocator(null); var root = new SimpleAggregateRoot(); root.InitializeServices(); }
protected override void OnTeardown() { base.OnTeardown(); ServiceLocatorUnitTestHelper.SetThreadLocalServiceLocator(null); Container = null; StructureMapContainer = null; }
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); }