mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
Detect if all Drives are indexed and show a warning if they aren't (#5015)
* opens new settings search options * Catching file not found exception * removed unnecessary header files * Added display strings and cleaned up code * reduced the number of max results to 30 * added log statement for exception * Added drive detection to settings ui but still doesn't reflect on toggling it * added getter setter for DriveDetectionWarning * Got UI and backend to work as expected * Reading value from registry working as expected * Added test for settings * Added tests for drive detection * rename drive detection * Localized indexer string * formatting * resolving merge conflict * Added theme aware warning icon * changed text for the warning * Added the warning images to the installer
This commit is contained in:
@@ -8,6 +8,7 @@ using Microsoft.Plugin.Indexer;
|
||||
using Moq;
|
||||
using Wox.Plugin;
|
||||
using System.Linq;
|
||||
using Microsoft.Plugin.Indexer.DriveDetection;
|
||||
|
||||
namespace Wox.Test.Plugins
|
||||
{
|
||||
@@ -297,5 +298,23 @@ namespace Wox.Test.Plugins
|
||||
mockapi.Verify(m => m.GetTranslation("Microsoft_plugin_indexer_open_containing_folder"), Times.Never());
|
||||
mockapi.Verify(m => m.GetTranslation("Microsoft_plugin_indexer_open_in_console"), Times.Once());
|
||||
}
|
||||
|
||||
[TestCase(0, false, ExpectedResult = false)]
|
||||
[TestCase(0, true, ExpectedResult = true)]
|
||||
[TestCase(1, false, ExpectedResult = true)]
|
||||
[TestCase(1, true, ExpectedResult = true)]
|
||||
public bool DriveDetection_MustDisplayResults_WhenEnhancedModeIsOnOrWhenWarningIsDisabled(int enhancedModeStatus, bool disableWarningCheckBoxStatus)
|
||||
{
|
||||
// Arrange
|
||||
var mockRegistry = new Mock<IRegistryWrapper>();
|
||||
mockRegistry.Setup(r => r.GetHKLMRegistryValue(It.IsAny<string>(), It.IsAny<string>())).Returns(enhancedModeStatus); // Enhanced mode is disabled
|
||||
|
||||
IndexerDriveDetection _driveDetection = new IndexerDriveDetection(mockRegistry.Object);
|
||||
_driveDetection.IsDriveDetectionWarningCheckBoxSelected = disableWarningCheckBoxStatus;
|
||||
|
||||
// Act & Assert
|
||||
return _driveDetection.DisplayResults();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user