Пример #1
0
        public void MRUEnabled_ShouldSetValue2True_WhenSuccessful()
        {
            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel();

            // Assert
            ShellPage.DefaultSndMSGCallback = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.IsTrue(snd.Powertoys.PowerRename.Properties.MRUEnabled.Value);
            };

            // act
            viewModel.MRUEnabled = true;
        }
Пример #2
0
        public void MaxDispListNum_ShouldSetMaxSuggListTo20_WhenSuccessful()
        {
            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel();

            // Assert
            ShellPage.DefaultSndMSGCallback = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.AreEqual(20, snd.Powertoys.PowerRename.Properties.MaxMRUSize.Value);
            };

            // act
            viewModel.MaxDispListNum = 20;
        }
Пример #3
0
        public void RestoreFlagsOnLaunch_ShouldSetValue2True_WhenSuccessful()
        {
            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel();

            // Assert
            ShellPage.DefaultSndMSGCallback = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.IsTrue(snd.Powertoys.PowerRename.Properties.PersistState.Value);
            };

            // act
            viewModel.RestoreFlagsOnLaunch = true;
        }
        public void EnabledOnContextExtendedMenu_ShouldSetValue2True_WhenSuccessful()
        {
            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel();

            // Assert
            ShellPage.DefaultSndMSGCallback = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.IsTrue(snd.Powertoys.PowerRename.properties.ShowIcon.Value);
            };

            // act
            viewModel.EnabledOnContextMenu = true;
        }
Пример #5
0
        public void MRUEnabledShouldSetValue2TrueWhenSuccessful()
        {
            // Assert
            Func <string, int> SendMockIPCConfigMSG = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.IsTrue(snd.Powertoys.PowerRename.Properties.MRUEnabled.Value);
                return(0);
            };

            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel(mockPowerRenamePropertiesUtils.Object, SettingsRepository <GeneralSettings> .GetInstance(mockGeneralSettingsUtils.Object), SendMockIPCConfigMSG, generalSettingsFileName);

            // act
            viewModel.MRUEnabled = true;
        }
Пример #6
0
        public void MaxDispListNumShouldSetMaxSuggListTo20WhenSuccessful()
        {
            // Assert
            Func <string, int> SendMockIPCConfigMSG = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.AreEqual(20, snd.Powertoys.PowerRename.Properties.MaxMRUSize.Value);
                return(0);
            };

            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel(mockPowerRenamePropertiesUtils.Object, SettingsRepository <GeneralSettings> .GetInstance(mockGeneralSettingsUtils.Object), SendMockIPCConfigMSG, generalSettingsFileName);

            // act
            viewModel.MaxDispListNum = 20;
        }
Пример #7
0
        public void MRUEnabled_ShouldSetValue2True_WhenSuccessful()
        {
            // Assert
            Func <string, int> SendMockIPCConfigMSG = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.IsTrue(snd.Powertoys.PowerRename.Properties.MRUEnabled.Value);
                return(0);
            };

            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel(ISettingsUtilsMocks.GetStubSettingsUtils().Object, SendMockIPCConfigMSG, generalSettings_file_name);

            // act
            viewModel.MRUEnabled = true;
        }
Пример #8
0
        public void MaxDispListNum_ShouldSetMaxSuggListTo20_WhenSuccessful()
        {
            // Assert
            Func <string, int> SendMockIPCConfigMSG = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.AreEqual(20, snd.Powertoys.PowerRename.Properties.MaxMRUSize.Value);
                return(0);
            };

            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel(ISettingsUtilsMocks.GetStubSettingsUtils().Object, SendMockIPCConfigMSG, generalSettings_file_name);

            // act
            viewModel.MaxDispListNum = 20;
        }
Пример #9
0
        public void RestoreFlagsOnLaunch_ShouldSetValue2True_WhenSuccessful()
        {
            // Assert
            Func <string, int> SendMockIPCConfigMSG = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.IsTrue(snd.Powertoys.PowerRename.Properties.PersistState.Value);
                return(0);
            };

            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel(SendMockIPCConfigMSG, generalSettings_file_name);

            // act
            viewModel.RestoreFlagsOnLaunch = true;
        }
Пример #10
0
        public void EnabledOnContextExtendedMenu_ShouldSetValue2True_WhenSuccessful()
        {
            // Assert
            Func <string, int> SendMockIPCConfigMSG = msg =>
            {
                PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize <PowerRenameSettingsIPCMessage>(msg);
                Assert.IsTrue(snd.Powertoys.PowerRename.Properties.ShowIcon.Value);
                return(0);
            };

            // arrange
            PowerRenameViewModel viewModel = new PowerRenameViewModel(SendMockIPCConfigMSG, generalSettings_file_name);

            // act
            viewModel.EnabledOnContextMenu = true;
        }