Packaged apps test (#4921)

* Added wrapper for PackageManager and Package class

* Added tests for package in development and framework mode

* Renamed UWP test file

* Improved readability of UWP tests
This commit is contained in:
Divyansh Srivastava
2020-07-10 13:43:02 -07:00
committed by GitHub
parent ec803d63c8
commit 653ae777d5
12 changed files with 389 additions and 39 deletions

View File

@@ -0,0 +1,41 @@
using Package = Windows.ApplicationModel.Package;
namespace Microsoft.Plugin.Program.Programs
{
public class PackageWrapper : IPackage
{
public string Name { get; }
public string FullName { get; }
public string FamilyName { get; }
public bool IsFramework { get; }
public bool IsDevelopmentMode { get; }
public string InstalledLocation { get; }
public PackageWrapper(string Name, string FullName, string FamilyName, bool IsFramework, bool IsDevelopmentMode, string InstalledLocation)
{
this.Name = Name;
this.FullName = FullName;
this.FamilyName = FamilyName;
this.IsFramework = IsFramework;
this.IsDevelopmentMode = IsDevelopmentMode;
this.InstalledLocation = InstalledLocation;
}
public static PackageWrapper GetWrapperFromPackage(Package package)
{
return new PackageWrapper(
package.Id.Name,
package.Id.FullName,
package.Id.FamilyName,
package.IsFramework,
package.IsDevelopmentMode,
package.InstalledLocation.Path
);
}
}
}