public void CanInitModule() { try { MockUnityContainer container = new MockUnityContainer(); var contentRegistry = new MockRegionViewRegistry(); container.ResolveTypes[typeof(IRegionViewRegistry)] = contentRegistry; ServiceLocator.SetLocatorProvider( () => new MockServiceLocator( () => contentRegistry)); MarketModule module = new MarketModule(container, new MockRegionManager()); module.Initialize(); Assert.IsTrue(container.Types.ContainsKey(typeof(IMarketHistoryService))); Assert.IsTrue(container.Types.ContainsKey(typeof(IMarketFeedService))); Assert.IsTrue(container.Types.ContainsKey(typeof(ITrendLineView))); Assert.IsTrue(container.Types.ContainsKey(typeof(ITrendLinePresentationModel))); } finally { ServiceLocator.SetLocatorProvider(() => null); } }
public void CanInitModule() { try { MockUnityContainer container = new MockUnityContainer(); var contentRegistry = new MockRegionViewRegistry(); container.ResolveTypes[typeof(IRegionViewRegistry)] = contentRegistry; ServiceLocator.SetLocatorProvider( () => new MockServiceLocator( () => contentRegistry)); MarketModule module = new MarketModule(container, new MockRegionManager()); module.Initialize(); Assert.IsTrue(container.Types.ContainsKey(typeof(IMarketHistoryService))); Assert.IsTrue(container.Types.ContainsKey(typeof(IMarketFeedService))); Assert.IsTrue(container.Types.ContainsKey(typeof(ITrendLineView))); Assert.IsTrue(container.Types.ContainsKey(typeof(ITrendLinePresentationModel))); } finally { ServiceLocator.SetLocatorProvider(() => null); } }