PowerLauncherSettings unit tests (#2276)

This commit is contained in:
Tomas Agustin Raies
2020-04-26 13:15:40 -07:00
committed by GitHub
parent ca7b6f139f
commit 7ec8d02c1f
5 changed files with 383 additions and 198 deletions

View File

@@ -2,10 +2,14 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.Json;
namespace Microsoft.PowerToys.Settings.UI.Lib
{
public class PowerLauncherSettings : BasePTModuleSettings
{
public const string POWERTOYNAME = "PowerLauncher";
public PowerLauncherProperties properties { get; set; }
public PowerLauncherSettings()
@@ -14,5 +18,16 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
version = "1";
name = "_unset_";
}
public virtual void Save()
{
// Save settings to file
var options = new JsonSerializerOptions
{
WriteIndented = true,
};
SettingsUtils.SaveSettings(JsonSerializer.Serialize(this, options), POWERTOYNAME);
}
}
}