public void CanInitModule() { var container = new MockUnityContainer(); MarketModule module = new MarketModule(container); 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(ITrendLinePresenter))); }
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); } }