From 1ab0a5182f010b5a211dddd2ae3fd5c0ee930794 Mon Sep 17 00:00:00 2001
From: Lavius Motileng <58791731+laviusmotileng-ms@users.noreply.github.com>
Date: Fri, 8 May 2020 08:22:57 -0700
Subject: [PATCH] [Settings V2] Upated Fancy Zone and Shortcut Guid default
values. (#2786)
* upated Fancy Zone and Shortcut Guid default values.
* upated fz tests
---
.../FZConfigProperties.cs | 32 +-
.../FancyZonesSettingsIPCMessage.cs | 28 ++
.../HotkeySettings.cs | 10 +
.../KeyBoardKeysProperty.cs | 5 +
.../ShortcutGuideProperties.cs | 6 +-
.../SndFancyZonesSettings.cs | 4 +
.../ViewModels/FancyZonesViewModel.cs | 22 +-
...crosoft.PowerToys.Settings.UnitTest.csproj | 1 +
.../ViewModelTests/FancyZones.cs | 346 ++++++++++++++++++
.../ViewModelTests/ShortcutGuide.cs | 3 +
10 files changed, 425 insertions(+), 32 deletions(-)
create mode 100644 src/core/Microsoft.PowerToys.Settings.UI.Lib/FancyZonesSettingsIPCMessage.cs
create mode 100644 src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/FancyZones.cs
diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/FZConfigProperties.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/FZConfigProperties.cs
index 89814dfa31..ce867a61a4 100644
--- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/FZConfigProperties.cs
+++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/FZConfigProperties.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.Settings.UI.Lib
@@ -9,23 +10,32 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
{
public FZConfigProperties()
{
- this.FancyzonesShiftDrag = new BoolProperty();
- this.FancyzonesMouseSwitch = new BoolProperty();
+ this.FancyzonesShiftDrag = new BoolProperty(true);
this.FancyzonesOverrideSnapHotkeys = new BoolProperty();
+ this.FancyzonesMouseSwitch = new BoolProperty();
this.FancyzonesMoveWindowsAcrossMonitors = new BoolProperty();
this.FancyzonesDisplayChangeMoveWindows = new BoolProperty();
this.FancyzonesZoneSetChangeMoveWindows = new BoolProperty();
this.FancyzonesVirtualDesktopChangeMoveWindows = new BoolProperty();
this.FancyzonesAppLastZoneMoveWindows = new BoolProperty();
- this.UseCursorposEditorStartupscreen = new BoolProperty();
+ this.UseCursorposEditorStartupscreen = new BoolProperty(true);
this.FancyzonesShowOnAllMonitors = new BoolProperty();
+ this.FancyzonesZoneHighlightColor = new StringProperty("#F5FCFF");
+ this.FancyzonesHighlightOpacity = new IntProperty(50);
+ this.FancyzonesEditorHotkey = new KeyBoardKeysProperty(
+ new HotkeySettings()
+ {
+ Win = true,
+ Ctrl = false,
+ Alt = false,
+ Shift = false,
+ Key = "`",
+ Code = 192,
+ });
this.FancyzonesMakeDraggedWindowTransparent = new BoolProperty();
- this.FancyzonesZoneHighlightColor = new StringProperty();
- this.FancyzonesHighlightOpacity = new IntProperty();
- this.FancyzonesEditorHotkey = new KeyBoardKeysProperty();
this.FancyzonesExcludedApps = new StringProperty();
- this.FancyzonesInActiveColor = new StringProperty();
- this.FancyzonesBorderColor = new StringProperty();
+ this.FancyzonesInActiveColor = new StringProperty("#F5FCFF");
+ this.FancyzonesBorderColor = new StringProperty("#F5FCFF");
}
[JsonPropertyName("fancyzones_shiftDrag")]
@@ -78,5 +88,11 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
[JsonPropertyName("fancyzones_zoneColor")]
public StringProperty FancyzonesInActiveColor { get; set; }
+
+ // converts the current to a json string.
+ public string ToJsonString()
+ {
+ return JsonSerializer.Serialize(this);
+ }
}
}
diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/FancyZonesSettingsIPCMessage.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/FancyZonesSettingsIPCMessage.cs
new file mode 100644
index 0000000000..75c0028439
--- /dev/null
+++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/FancyZonesSettingsIPCMessage.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace Microsoft.PowerToys.Settings.UI.Lib
+{
+ public class FancyZonesSettingsIPCMessage
+ {
+ [JsonPropertyName("powertoys")]
+ public SndFancyZonesSettings Powertoys { get; set; }
+
+ public FancyZonesSettingsIPCMessage()
+ {
+ }
+
+ public FancyZonesSettingsIPCMessage(SndFancyZonesSettings settings)
+ {
+ this.Powertoys = settings;
+ }
+
+ public string ToJsonString()
+ {
+ return JsonSerializer.Serialize(this);
+ }
+ }
+}
diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/HotkeySettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/HotkeySettings.cs
index bfd4bb6dcc..216d024eb6 100644
--- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/HotkeySettings.cs
+++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/HotkeySettings.cs
@@ -20,6 +20,16 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
this.Code = 0;
}
+ public HotkeySettings(bool win, bool ctrl, bool alt, bool shift, string key, int code)
+ {
+ Win = win;
+ Ctrl = ctrl;
+ Alt = alt;
+ Shift = shift;
+ Key = key;
+ Code = code;
+ }
+
[JsonPropertyName("win")]
public bool Win { get; set; }
diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyBoardKeysProperty.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyBoardKeysProperty.cs
index dd4d50571a..188c4287bf 100644
--- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyBoardKeysProperty.cs
+++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyBoardKeysProperty.cs
@@ -16,6 +16,11 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
this.Value = new HotkeySettings();
}
+ public KeyBoardKeysProperty(HotkeySettings hkSettings)
+ {
+ this.Value = hkSettings;
+ }
+
[JsonPropertyName("value")]
public HotkeySettings Value { get; set; }
}
diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ShortcutGuideProperties.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ShortcutGuideProperties.cs
index 832570e038..11b0193f12 100644
--- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ShortcutGuideProperties.cs
+++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ShortcutGuideProperties.cs
@@ -14,9 +14,9 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
{
public ShortcutGuideProperties()
{
- OverlayOpacity = new IntProperty();
- PressTime = new IntProperty();
- Theme = new StringProperty();
+ OverlayOpacity = new IntProperty(90);
+ PressTime = new IntProperty(900);
+ Theme = new StringProperty("light");
}
[JsonPropertyName("overlay_opacity")]
diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/SndFancyZonesSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/SndFancyZonesSettings.cs
index 52d3333579..bc59879e5a 100644
--- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/SndFancyZonesSettings.cs
+++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/SndFancyZonesSettings.cs
@@ -10,6 +10,10 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
{
public FancyZonesSettings FancyZones { get; set; }
+ public SndFancyZonesSettings()
+ {
+ }
+
public SndFancyZonesSettings(FancyZonesSettings settings)
{
this.FancyZones = settings;
diff --git a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/FancyZonesViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/FancyZonesViewModel.cs
index 84c5688c97..f3d3a838cb 100644
--- a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/FancyZonesViewModel.cs
+++ b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/FancyZonesViewModel.cs
@@ -112,7 +112,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
OutGoingGeneralSettings snd = new OutGoingGeneralSettings(generalSettings);
ShellPage.DefaultSndMSGCallback(snd.ToString());
- RaisePropertyChanged();
+ OnPropertyChanged("IsEnabled");
}
}
}
@@ -387,26 +387,6 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
}
- /*
- public int EditorHotkey
- {
- get
- {
- return _editorHotkey;
- }
-
- set
- {
- if (value != _editorHotkey)
- {
- _editorHotkey = value;
- Settings.Properties.FancyzonesHighlightOpacity.Value = value;
- RaisePropertyChanged();
- }
- }
- }
- */
-
public HotkeySettings EditorHotkey
{
get
diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/Microsoft.PowerToys.Settings.UnitTest.csproj b/src/core/Microsoft.PowerToys.Settings.UnitTest/Microsoft.PowerToys.Settings.UnitTest.csproj
index ce6b422d7e..1b8f79345c 100644
--- a/src/core/Microsoft.PowerToys.Settings.UnitTest/Microsoft.PowerToys.Settings.UnitTest.csproj
+++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/Microsoft.PowerToys.Settings.UnitTest.csproj
@@ -119,6 +119,7 @@
+
diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/FancyZones.cs b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/FancyZones.cs
new file mode 100644
index 0000000000..dfc738aaec
--- /dev/null
+++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/FancyZones.cs
@@ -0,0 +1,346 @@
+using Microsoft.PowerToys.Settings.UI.Lib;
+using Microsoft.PowerToys.Settings.UI.ViewModels;
+using Microsoft.PowerToys.Settings.UI.Views;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using Windows.UI;
+
+namespace ViewModelTests
+{
+ [TestClass]
+ public class FancyZones
+ {
+ public const string ModuleName = "FancyZones";
+
+ [TestInitialize]
+ public void Setup()
+ {
+ // initialize creation of test settings file.
+ GeneralSettings generalSettings = new GeneralSettings();
+ FZConfigProperties fZConfigProperties = new FZConfigProperties();
+
+ SettingsUtils.SaveSettings(generalSettings.ToJsonString());
+ SettingsUtils.SaveSettings(fZConfigProperties.ToJsonString(), ModuleName);
+ }
+
+ [TestCleanup]
+ public void CleanUp()
+ {
+ // delete folder created.
+ string generalSettings_file_name = string.Empty;
+ if (SettingsUtils.SettingsFolderExists(generalSettings_file_name))
+ {
+ DeleteFolder(generalSettings_file_name);
+ }
+
+ if (SettingsUtils.SettingsFolderExists(ModuleName))
+ {
+ DeleteFolder(ModuleName);
+ }
+ }
+
+ public void DeleteFolder(string powertoy)
+ {
+ Directory.Delete(Path.Combine(SettingsUtils.LocalApplicationDataFolder(), $"Microsoft\\PowerToys\\{powertoy}"), true);
+ }
+
+ [TestMethod]
+ public void IsEnabled_ShouldDisableModule_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsTrue(viewModel.IsEnabled); // check if the module is enabled.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ OutGoingGeneralSettings snd = JsonSerializer.Deserialize(msg);
+ Assert.IsFalse(snd.GeneralSettings.Enabled.FancyZones);
+ };
+
+ // act
+ viewModel.IsEnabled = false;
+ }
+
+ [TestMethod]
+ public void ShiftDrag_ShouldSetValue2False_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsTrue(viewModel.ShiftDrag); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsFalse(snd.Powertoys.FancyZones.Properties.FancyzonesShiftDrag.Value);
+ };
+
+ // act
+ viewModel.ShiftDrag = false;
+ }
+
+ [TestMethod]
+ public void OverrideSnapHotkeys_ShouldSetValue2True_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsFalse(viewModel.OverrideSnapHotkeys); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesOverrideSnapHotkeys.Value);
+ };
+
+ // act
+ viewModel.OverrideSnapHotkeys = true;
+ }
+
+ [TestMethod]
+ public void ZoneSetChangeFlashZones_ShouldSetValue2False_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsFalse(viewModel.MakeDraggedWindowsTransparent); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesMakeDraggedWindowTransparent.Value);
+ };
+
+ // act
+ viewModel.MakeDraggedWindowsTransparent = true;
+ }
+
+ [TestMethod]
+ public void MouseSwitch_ShouldSetValue2True_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsFalse(viewModel.MouseSwitch); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesMouseSwitch.Value);
+ };
+
+ // act
+ viewModel.MouseSwitch = true;
+ }
+
+ [TestMethod]
+ public void DisplayChangeMoveWindows_ShouldSetValue2True_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsFalse(viewModel.DisplayChangeMoveWindows); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesDisplayChangeMoveWindows.Value);
+ };
+
+ // act
+ viewModel.DisplayChangeMoveWindows = true;
+ }
+
+ [TestMethod]
+ public void ZoneSetChangeMoveWindows_ShouldSetValue2True_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsFalse(viewModel.ZoneSetChangeMoveWindows); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesZoneSetChangeMoveWindows.Value);
+ };
+
+ // act
+ viewModel.ZoneSetChangeMoveWindows = true;
+ }
+
+ [TestMethod]
+ public void VirtualDesktopChangeMoveWindows_ShouldSetValue2True_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsFalse(viewModel.VirtualDesktopChangeMoveWindows); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesVirtualDesktopChangeMoveWindows.Value);
+ };
+
+ // act
+ viewModel.VirtualDesktopChangeMoveWindows = true;
+ }
+
+ [TestMethod]
+ public void AppLastZoneMoveWindows_ShouldSetValue2True_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsFalse(viewModel.AppLastZoneMoveWindows); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesAppLastZoneMoveWindows.Value);
+ };
+
+ // act
+ viewModel.AppLastZoneMoveWindows = true;
+ }
+
+ [TestMethod]
+ public void UseCursorPosEditorStartupScreen_ShouldSetValue2False_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsTrue(viewModel.UseCursorPosEditorStartupScreen); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsTrue(snd.Powertoys.FancyZones.Properties.UseCursorposEditorStartupscreen.Value);
+ };
+
+ // act
+ viewModel.UseCursorPosEditorStartupScreen = true;
+ }
+
+ [TestMethod]
+ public void ShowOnAllMonitors_ShouldSetValue2True_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.IsFalse(viewModel.ShowOnAllMonitors); // check if value was initialized to false.
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesShowOnAllMonitors.Value);
+ };
+
+ // act
+ viewModel.ShowOnAllMonitors = true;
+ }
+
+ [TestMethod]
+ public void ZoneHighlightColor_ShouldSetColorValue2White_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.AreEqual("#F5FCFF", ToRGBHex(viewModel.ZoneHighlightColor));
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.AreEqual("#E1E1E1", snd.Powertoys.FancyZones.Properties.FancyzonesZoneHighlightColor.Value);
+ };
+
+ // act
+ viewModel.ZoneHighlightColor = Color.FromArgb(0, 225,225,225);
+ }
+
+ [TestMethod]
+ public void ZoneBorderColor_ShouldSetColorValue2White_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.AreEqual("#F5FCFF", ToRGBHex(viewModel.ZoneBorderColor));
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.AreEqual("#E1E1E1", snd.Powertoys.FancyZones.Properties.FancyzonesBorderColor.Value);
+ };
+
+ // act
+ viewModel.ZoneBorderColor = Color.FromArgb(0, 225, 225, 225);
+ }
+
+ [TestMethod]
+ public void ZoneInActiveColor_ShouldSetColorValue2White_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.AreEqual("#F5FCFF", ToRGBHex(viewModel.ZoneInActiveColor));
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.AreEqual("#E1E1E1", snd.Powertoys.FancyZones.Properties.FancyzonesInActiveColor.Value);
+ };
+
+ // act
+ viewModel.ZoneInActiveColor = Color.FromArgb(0, 225, 225, 225);
+ }
+
+ [TestMethod]
+ public void ExcludedApps_ShouldSetColorValue2White_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.AreEqual("", viewModel.ExcludedApps);
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.AreEqual("Sample", snd.Powertoys.FancyZones.Properties.FancyzonesExcludedApps.Value);
+ };
+
+ // act
+ viewModel.ExcludedApps = "Sample";
+ }
+
+ [TestMethod]
+ public void HighlightOpacity_ShouldSetOpacityValueTo60_WhenSuccessful()
+ {
+ // arrange
+ FancyZonesViewModel viewModel = new FancyZonesViewModel();
+ Assert.AreEqual(50, viewModel.HighlightOpacity);
+
+ // Assert
+ ShellPage.DefaultSndMSGCallback = msg =>
+ {
+ FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize(msg);
+ Assert.AreEqual(60, snd.Powertoys.FancyZones.Properties.FancyzonesHighlightOpacity.Value);
+ };
+
+ // act
+ viewModel.HighlightOpacity = 60;
+ }
+
+ private String ToRGBHex(Color color)
+ {
+ return "#" + color.R.ToString("X2") + color.G.ToString("X2") + color.B.ToString("X2");
+ }
+ }
+}
diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ShortcutGuide.cs b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ShortcutGuide.cs
index e502f2bab0..d050116930 100644
--- a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ShortcutGuide.cs
+++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ShortcutGuide.cs
@@ -74,6 +74,7 @@ namespace ViewModelTests
{
// Arrange
ShortcutGuideViewModel viewModel = new ShortcutGuideViewModel();
+ Assert.AreEqual(1, viewModel.ThemeIndex);
// Assert
// Initilize mock function of sending IPC message.
@@ -92,6 +93,7 @@ namespace ViewModelTests
{
// Arrange
ShortcutGuideViewModel viewModel = new ShortcutGuideViewModel();
+ Assert.AreEqual(900, viewModel.PressTime);
// Assert
// Initilize mock function of sending IPC message.
@@ -110,6 +112,7 @@ namespace ViewModelTests
{
// Arrange
ShortcutGuideViewModel viewModel = new ShortcutGuideViewModel();
+ Assert.AreEqual(90, viewModel.OverlayOpacity);
// Assert
// Initilize mock function of sending IPC message.