Esempio n. 1
0
        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)));
        }
Esempio n. 2
0
        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)));
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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);
            }
        }