-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing Regions field to DismAppxPackage_
This was causing fatal errors when marshalling the struct because the size was off. Also added a unit test. Fixes #58
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/Microsoft.Dism.Tests/GetProvisionedAppxPackagesTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c). All rights reserved. | ||
// | ||
// Licensed under the MIT license. | ||
|
||
using Shouldly; | ||
using System; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Microsoft.Dism.Tests | ||
{ | ||
public class GetProvisionedAppxPackagesTest : DismTestBase | ||
{ | ||
public GetProvisionedAppxPackagesTest(TestWimTemplate template, ITestOutputHelper testOutput) | ||
: base(template, testOutput) | ||
{ | ||
} | ||
|
||
[Fact] | ||
public void GetProvisionedAppxPackagesSimple() | ||
{ | ||
using (DismSession onlineSession = DismApi.OpenOnlineSession()) | ||
{ | ||
DismAppxPackageCollection packages = DismApi.GetProvisionedAppxPackages(onlineSession); | ||
|
||
packages.ShouldNotBeNull(); | ||
packages.Count.ShouldBeGreaterThan(0); | ||
|
||
foreach (DismAppxPackage package in packages) | ||
{ | ||
package.Architecture.ShouldNotBe(DismProcessorArchitecture.None); | ||
package.DisplayName.ShouldNotBeNullOrWhiteSpace(); | ||
package.InstallLocation.ShouldNotBeNullOrWhiteSpace(); | ||
package.PackageName.ShouldNotBeNullOrWhiteSpace(); | ||
package.PublisherId.ShouldNotBeNullOrWhiteSpace(); | ||
package.ResourceId.ShouldNotBeNullOrWhiteSpace(); | ||
package.Version.ShouldBeGreaterThan(Version.Parse("0.0.0.0")); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters