mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Display Drive detection warning only for multiple drives (#7589)
* indexer drive detection helper code to not show the warning for a single drive * removed interface from the namespace due to stylecop * removed interfac which no longer exists * filter out only fixed drives in the system and ignore the removable drives * changed text to not all files are indexed, from not all drives are idnexed * add additional info in the comment
This commit is contained in:
@@ -348,17 +348,21 @@ namespace Wox.Test.Plugins
|
||||
Assert.AreEqual(Microsoft.Plugin.Indexer.Properties.Resources.Microsoft_plugin_indexer_open_in_console, contextMenuItems[1].Title);
|
||||
}
|
||||
|
||||
[TestCase(0, false, ExpectedResult = true)]
|
||||
[TestCase(0, true, ExpectedResult = false)]
|
||||
[TestCase(1, false, ExpectedResult = false)]
|
||||
[TestCase(1, true, ExpectedResult = false)]
|
||||
public bool DriveDetectionMustDisplayWarningWhenEnhancedModeIsOffAndWhenWarningIsNotDisabled(int enhancedModeStatus, bool disableWarningCheckBoxStatus)
|
||||
[TestCase(0, 2, false, ExpectedResult = true)]
|
||||
[TestCase(0, 3, true, ExpectedResult = false)]
|
||||
[TestCase(1, 2, false, ExpectedResult = false)]
|
||||
[TestCase(1, 4, true, ExpectedResult = false)]
|
||||
[TestCase(0, 1, false, ExpectedResult = false)]
|
||||
public bool DriveDetectionMustDisplayWarningWhenEnhancedModeIsOffAndWhenWarningIsNotDisabled(int enhancedModeStatus, int driveCount, 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);
|
||||
var mockDriveInfo = new Mock<IDriveInfoWrapper>();
|
||||
mockDriveInfo.Setup(d => d.GetDriveCount()).Returns(driveCount);
|
||||
|
||||
IndexerDriveDetection driveDetection = new IndexerDriveDetection(mockRegistry.Object, mockDriveInfo.Object);
|
||||
driveDetection.IsDriveDetectionWarningCheckBoxSelected = disableWarningCheckBoxStatus;
|
||||
|
||||
// Act & Assert
|
||||
|
||||
Reference in New Issue
Block a user