public void ShouldRemove_AllAddonsData_FromConfiguration()
        {
            _fileSystemManagerMock.Setup(x => x.DirectoryExists(It.IsAny <string>())).Returns(false);

            var configurationManager = _configManagerMock.Object;
            var configuration        = new GW2_Addon_Manager.Configuration(configurationManager, _updateHelperMock.Object,
                                                                           _fileSystemManagerMock.Object);

            configuration.DeleteAllAddons();

            Assert.That(configurationManager.UserConfig.AddonsList, Is.Empty);
            Assert.That(configurationManager.UserConfig.LoaderVersion, Is.Null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Deletes all addons and resets config to default state.
        /// <seealso cref="OpeningViewModel.CleanInstall"/>
        /// <seealso cref="Configuration.DeleteAllAddons"/>
        /// </summary>
        public static void DeleteAll()
        {
            string deletemsg = "This will delete ALL add-ons from Guild Wars 2 and all data associated with them! Are you sure you wish to continue?";
            string secondPrecautionaryMsg = "Are you absolutely sure you want to delete all addons? This action cannot be undone.";

            //precautionary "are you SURE" messages x2
            if (MessageBox.Show(deletemsg, "Warning!", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
            {
                if (MessageBox.Show(secondPrecautionaryMsg, "Absolutely Sure?", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                {
                    Configuration.DeleteAllAddons();
                }
            }

            //post-delete info message
            MessageBox.Show("All addons have been removed.", "Reverted to Clean Install", MessageBoxButton.OK, MessageBoxImage.Information);
            Configuration.DisplayAddonStatus();
        }