public void Setup()
        {
            _navigationManager = new NavigationManager(PortalControllerMock());
            TabController.SetTestableInstance(TabControllerMock());
            LocaleController.SetTestableInstance(LocaleControllerMock());

            IPortalController PortalControllerMock()
            {
                var mockPortalController = new Mock <IPortalController>();

                mockPortalController
                .Setup(x => x.GetCurrentPortalSettings())
                .Returns(PortalSettingsMock());
                mockPortalController
                .Setup(x => x.GetCurrentSettings())
                .Returns(PortalSettingsMock());

                return(mockPortalController.Object);

                PortalSettings PortalSettingsMock()
                {
                    var portalSettings = new PortalSettings
                    {
                        PortalId  = PortalID,
                        ActiveTab = new TabInfo
                        {
                            TabID = TabID
                        }
                    };

                    return(portalSettings);
                }
            }

            ITabController TabControllerMock()
            {
                var mockTabController = new Mock <ITabController>();

                mockTabController
                .Setup(x => x.GetTabsByPortal(Null.NullInteger))
                .Returns(default(TabCollection));
                mockTabController
                .Setup(x => x.GetTab(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <bool>()))
                .Returns(new TabInfo
                {
                    CultureCode = "en-US"
                });

                return(mockTabController.Object);
            }

            ILocaleController LocaleControllerMock()
            {
                var mockLocaleController = new Mock <ILocaleController>();

                mockLocaleController
                .Setup(x => x.GetLocales(It.IsAny <int>()))
                .Returns(new Dictionary <string, Locale>
                {
                    { "en-US", new Locale() },
                    { "TEST", new Locale() }
                });

                return(mockLocaleController.Object);
            }
        }
        public void Setup()
        {
            this.navigationManager = new NavigationManager(PortalControllerMock());
            TabController.SetTestableInstance(TabControllerMock());
            LocaleController.SetTestableInstance(LocaleControllerMock());

            IPortalController PortalControllerMock()
            {
                var mockPortalController = new Mock <IPortalController>();

                mockPortalController
                .Setup(x => x.GetCurrentPortalSettings())
                .Returns(PortalSettingsMock());
                mockPortalController
                .Setup(x => x.GetCurrentSettings())
                .Returns(PortalSettingsMock());

                return(mockPortalController.Object);

                PortalSettings PortalSettingsMock()
                {
                    var portalSettings = new PortalSettings
                    {
                        PortalId  = PortalID,
                        ActiveTab = new TabInfo
                        {
                            TabID = TabID,
                        },
                    };

                    return(portalSettings);
                }
            }

            ITabController TabControllerMock()
            {
                var mockTabController = new Mock <ITabController>();

                mockTabController
                .Setup(x => x.GetTabsByPortal(Null.NullInteger))
                .Returns(default(TabCollection));
                mockTabController
                .Setup(x => x.GetTab(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <bool>()))
                .Returns(new TabInfo
                {
                    CultureCode = "en-US",
                });

                return(mockTabController.Object);
            }

            ILocaleController LocaleControllerMock()
            {
                var mockLocaleController = new Mock <ILocaleController>();

                mockLocaleController
                .Setup(x => x.GetLocales(It.IsAny <int>()))
                .Returns(new Dictionary <string, Locale>
                {
                    { "en-US", new Locale() },
                    { "TEST", new Locale() },
                });

                return(mockLocaleController.Object);
            }

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddTransient <INavigationManager>(container => this.navigationManager);
            serviceCollection.AddTransient <IApplicationStatusInfo>(container => new DotNetNuke.Application.ApplicationStatusInfo(Mock.Of <IApplicationInfo>()));
            serviceCollection.AddTransient <IHostSettingsService, HostController>();
            Globals.DependencyProvider = serviceCollection.BuildServiceProvider();
        }