public void Models_SystemGlobals_SelectDataSourceEnum_LiveTest_Should_Pass()
        {
            // Arrange

            // Act
            var result = SystemGlobalsModel.SelectDataSourceEnum("azurewebsites.net");

            // Assert
            Assert.AreEqual(result, DataSourceEnum.ServerTest, TestContext.TestName);
        }
        public void Models_SystemGlobals_SelectDataSourceEnum_Other_Should_Pass()
        {
            // Arrange

            // Act
            var result = SystemGlobalsModel.SelectDataSourceEnum("other");

            // Assert
            Assert.AreEqual(result, DataSourceEnum.Mock, TestContext.TestName);
        }
Exemple #3
0
        /// <summary>
        /// Change between demo, default, and UT data sets
        /// </summary>
        /// <param name="SetEnum"></param>
        public static void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
        {
            // Remember the Settigns
            SystemGlobalsModel.SetDataSourceDataSetEnum(SetEnum);

            // Add YourName Below Here #4, at the top of the stack, not the bottom
            //RoleBackend.SetDataSourceDataSet(SetEnum);
            //UserBackend.SetDataSourceDataSet(SetEnum);

            // Call for Navigation to reset to rebuild the cache
            //NavigationHelper.ResetCache();
        }
Exemple #4
0
        /// <summary>
        /// Changes the data source, does not call for a reset, that allows for hot swapping but keeping the original data in place
        /// </summary>
        public static void SetDataSource(DataSourceEnum dataSourceEnum)
        {
            // Set the Global DataSourceEnum Value

            SystemGlobalsModel.SetDataSourceEnum(dataSourceEnum);

            // Add YourName Below Here #5, at the top of the stack, not the bottom
            //RoleBackend.SetDataSource(SystemGlobalsModel.Instance.DataSourceValue);
            //UserBackend.SetDataSource(SystemGlobalsModel.Instance.DataSourceValue);

            // Call for Navigation to reset to rebuild the cache
            //NavigationHelper.ResetCache();
        }
        /// <summary>
        /// Changes the data source, does not call for a reset, that allows for how swapping but keeping the original data in place
        /// </summary>
        public void SetDataSource(DataSourceEnum dataSourceEnum)
        {
            // Set the Global DataSourceEnum Value
            SystemGlobalsModel.SetDataSourceEnum(dataSourceEnum);

            // Avatar must be reset before Student, because Student needs the default avatar

            AvatarItemBackend.SetDataSource(SystemGlobalsModel.Instance.DataSourceValue);
            KioskSettingsBackend.SetDataSource(SystemGlobalsModel.Instance.DataSourceValue);

            SchoolDismissalSettingsBackend.SetDataSource(SystemGlobalsModel.Instance.DataSourceValue);

            StudentBackend.SetDataSource(SystemGlobalsModel.Instance.DataSourceValue);
        }
Exemple #6
0
        /// <summary>
        /// Base Constructor takes the context and the identity
        /// </summary>
        /// <param name="httpContextAccessor"></param>
        /// <param name="userManager"></param>
        /// <param name="signInManager"></param>
        public BaseController(
            IHttpContextAccessor httpContextAccessor,
            UserManager <TechnicianModel> userManager,
            SignInManager <TechnicianModel> signInManager)
        {
            _context = httpContextAccessor.HttpContext;

            SystemGlobalsModel.SetHostPath(_context.Request.Host.ToString());

            _userManager = userManager;

            _signInManager = signInManager;

            _currentUser = GetCurrentUser();

            _roles = GetCurrentUserRoles();
        }
        /// <summary>
        /// Changes the data source, does not call for a reset, that allows for how swapping but keeping the original data in place
        /// </summary>
        public void SetDataSource(DataSourceEnum dataSourceEnum)
        {
            // Set the Global DataSourceEnum Value
            SystemGlobalsModel.SetDataSourceEnum(dataSourceEnum);

            ExampleBackend.SetDataSource(dataSourceEnum);
            PhotoBackend.SetDataSource(dataSourceEnum);
            ClinicBackend.SetDataSource(dataSourceEnum);
            ResultLogBackend.SetDataSource(dataSourceEnum);
            ResultDataBackend.SetDataSource(dataSourceEnum);
            PhoneBackend.SetDataSource(dataSourceEnum);
            TechnicianBackend.SetDataSource(dataSourceEnum);
            InventoryBackend.SetDataSource(dataSourceEnum);
            VersionOSBackend.SetDataSource(dataSourceEnum);
            VersionAppBackend.SetDataSource(dataSourceEnum);
            HistoryOSBackend.SetDataSource(dataSourceEnum);
            HistoryAppBackend.SetDataSource(dataSourceEnum);
            // Add YourName Above Here #5
        }