Exemple #1
0
        public void GetStoredCheckedState_Default_IsTrue()
        {
            SettingsGeneralViewModel vm = new SettingsGeneralViewModel();
            bool storedCheckedState     = vm.GetStoredCheckedState();

            Assert.True(storedCheckedState);
        }
Exemple #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            InitLabel(Header, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_TITLE, 24, 28);
            InitLabel(HeaderLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_EXPLANATION_ONE, 26, 28);
            InitLabel(ContentLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_MOBILE_DATA_HEADER, 18, 28);
            InitLabel(ContentLabelOne, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_EXPLANATION_TWO, 16, 28);
            InitLabel(DescriptionLabel, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_MOBILE_DATA_DESC, 14, 28);
            InitLabel(ChooseLanguageHeaderLbl, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_CHOOSE_LANGUAGE_HEADER, 16, 28);
            InitLabel(RadioButton1Lbl, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_NB, 16, 28);
            InitLabel(RadioButton2Lbl, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_NN, 16, 28);
            InitLabel(RadioButton3Lbl, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_EN, 16, 28);

            InitLabel(RestartAppLabl, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_RESTART_REQUIRED_TEXT, 14, 28);
            InitLabel(SmittestopLinkButtionLbl, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_MORE_INFO_BUTTON_TEXT, 16, 28);

            //Implemented for correct voiceover due to Back button
            BackButton.AccessibilityLabel = SettingsViewModel.SETTINGS_CHILD_PAGE_ACCESSIBILITY_BACK_BUTTON;

            //Implemented for correct voiceover due to last paragraph and link
            SmittestopLinkButtionLbl.AccessibilityLabel =
                SettingsGeneralViewModel.SETTINGS_GENERAL_ACCESSIBILITY_MORE_INFO_BUTTON_TEXT;

            //Implemented for correct voiceover due to smitte|stop, removing pronunciation of lodretstreg
            ContentLabel.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(SettingsGeneralViewModel.SETTINGS_GENERAL_MOBILE_DATA_HEADER);

            _viewModel = new SettingsGeneralViewModel();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SetupStyling();

            _viewModel = new SettingsGeneralViewModel();
        }
Exemple #4
0
        public void OnCheckedChange_SetsValue_False()
        {
            SettingsGeneralViewModel vm = new SettingsGeneralViewModel();

            vm.OnCheckedChange(false);
            bool storedCheckedState = vm.GetStoredCheckedState();

            Assert.False(storedCheckedState);
        }
        public void IsAutoBackupEnabled_StopService()
        {
            // Arrange
            var settingsManagerMock = new Mock <ISettingsManager>();

            settingsManagerMock.SetupGet(x => x.IsBackupAutouploadEnabled).Returns(true);

            var taskStopped           = false;
            var backgroundTaskManager = new Mock <IBackgroundTaskManager>();

            backgroundTaskManager.Setup(x => x.StopBackupSyncTask()).Callback(() => taskStopped = true);

            // Act
            var vm = new SettingsGeneralViewModel(settingsManagerMock.Object, backgroundTaskManager.Object);

            vm.IsAutoBackupEnabled = false;

            // Assert
            Assert.True(taskStopped);
        }
        public void BackupSyncRecurrence(int passedValue, int expectedValue)
        {
            // Arrange
            var settingsManagerMock = new Mock <ISettingsManager>();

            settingsManagerMock.SetupAllProperties();

            var taskStarted           = false;
            var backgroundTaskManager = new Mock <IBackgroundTaskManager>();

            backgroundTaskManager.Setup(x => x.StartBackupSyncTask()).Callback(() => taskStarted = true);

            // Act
            var vm = new SettingsGeneralViewModel(settingsManagerMock.Object, backgroundTaskManager.Object);

            vm.BackupSyncRecurrence = passedValue;

            // Assert
            Assert.True(taskStarted);
            Assert.Equal(expectedValue, vm.BackupSyncRecurrence);
        }
 void OnSmittestopLinkButtonStackViewTapped(UITapGestureRecognizer recognizer)
 {
     SettingsGeneralViewModel.OpenSmitteStopLink();
 }