Io abstraction (#7293)

Co-authored-by: p-storm <paul.de.man@gmail.com>
This commit is contained in:
P-Storm
2020-11-02 18:33:43 +01:00
committed by GitHub
parent 5c3eef0112
commit 0d4017fe1a
109 changed files with 700 additions and 678 deletions

View File

@@ -2,7 +2,7 @@
// 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.IO;
using System.IO.Abstractions;
namespace Microsoft.Plugin.Program
{
@@ -16,11 +16,13 @@ namespace Microsoft.Plugin.Program
/// </remarks>
public class ProgramSource
{
private static readonly IFileSystem FileSystem = new FileSystem();
private string name;
public string Location { get; set; }
public string Name { get => name ?? new DirectoryInfo(Location).Name; set => name = value; }
public string Name { get => name ?? FileSystem.DirectoryInfo.FromDirectoryName(Location).Name; set => name = value; }
public bool Enabled { get; set; } = true;