[stylecop] program plugin/unit test first pass (#5908)

* initial pass

* multiple whitespace fixes
This commit is contained in:
Clint Rutkas
2020-08-12 11:46:11 -07:00
committed by GitHub
parent 8888739867
commit 95e82ca359
36 changed files with 351 additions and 273 deletions

View File

@@ -1,11 +1,15 @@
using Windows.ApplicationModel;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Microsoft.Plugin.Program.Storage
{
internal interface IProgramRepository
{
void IndexPrograms();
void Load();
void Save();
}
}

View File

@@ -1,10 +1,12 @@
using Microsoft.Plugin.Program.Logger;
using Microsoft.Plugin.Program.Programs;
// Copyright (c) Microsoft Corporation
// 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;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Plugin.Program.Logger;
using Microsoft.Plugin.Program.Programs;
using Windows.ApplicationModel;
using Wox.Infrastructure.Storage;
@@ -19,6 +21,7 @@ namespace Microsoft.Plugin.Program.Storage
private IStorage<IList<UWPApplication>> _storage;
private IPackageCatalog _packageCatalog;
public PackageRepository(IPackageCatalog packageCatalog, IStorage<IList<UWPApplication>> storage)
{
_storage = storage ?? throw new ArgumentNullException(nameof(storage), "StorageRepository requires an initialized storage interface");

View File

@@ -1,4 +1,8 @@
using System;
// Copyright (c) Microsoft Corporation
// 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;
using System.Collections.Generic;
using Wox.Infrastructure.Storage;
@@ -25,7 +29,7 @@ namespace Microsoft.Plugin.Program.Storage
{
Environment.GetFolderPath(Environment.SpecialFolder.Programs),
Environment.GetFolderPath(Environment.SpecialFolder.CommonPrograms),
Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
};
return paths;
}

View File

@@ -1,16 +1,18 @@
using System;
// Copyright (c) Microsoft Corporation
// 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;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Microsoft.Plugin.Program.Programs;
using Wox.Infrastructure.Logger;
using Wox.Infrastructure.Storage;
using System.IO;
using System.Linq;
using System.Globalization;
using System.IO;
using Wox.Infrastructure.Logger;
using Wox.Infrastructure.Storage;
using Win32Program = Microsoft.Plugin.Program.Programs.Win32Program;
namespace Microsoft.Plugin.Program.Storage
{
using Win32Program = Programs.Win32Program;
internal class Win32ProgramRepository : ListRepository<Programs.Win32Program>, IProgramRepository
{
private IStorage<IList<Programs.Win32Program>> _storage;
@@ -92,8 +94,7 @@ namespace Microsoft.Plugin.Program.Storage
{
Log.Info($"|Win32ProgramRepository|OnAppRenamed-{extension}Program|{oldPath}|Unable to create program from {oldPath}| {ex.Message}");
}
// To remove the old app which has been renamed and to add the new application.
if (oldApp != null)
{