Add xUnit tests for async DISM API methods#3
Closed
Copilot wants to merge 3 commits intocopilot/add-async-await-support-dism-operationsfrom
Closed
Add xUnit tests for async DISM API methods#3Copilot wants to merge 3 commits intocopilot/add-async-await-support-dism-operationsfrom
Copilot wants to merge 3 commits intocopilot/add-async-await-support-dism-operationsfrom
Conversation
Owner
|
Once you’re done with the tests, please also merge your changes into the branch copilot/add-async-await-support-dism-operations (PR #2) so everything is in one branch, then I will close this PR. |
Agent-Logs-Url: https://github.com/Rolling2405/ManagedDism/sessions/d65e954e-2d3a-40a3-b2e6-9a60227a96c5 Co-authored-by: Rolling2405 <89894749+Rolling2405@users.noreply.github.com>
…thods - Remove private nested SynchronousProgress<T> class from all 12 async test files (a shared SynchronousProgress.cs already exists) - Rename _CompletesSuccessfully to _ThrowsDismException for 11 test methods that assert Should.ThrowAsync<DismException>, keeping the name accurate Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Rolling2405 <89894749+Rolling2405@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add xUnit tests for async DISM API methods
Add xUnit tests for async DISM API methods
Mar 30, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds test coverage for all 17 async DISM API methods introduced in this branch. 51 test methods across 12 test files, plus a shared helper.
Test structure
Each async method gets three tests:
CheckImageHealthAsync,RestoreImageHealthAsync,MountImageAsync) assert successful completion; methods requiring unavailable resources (packages, features, editions) assertDismExceptionpropagation through the async wrapperCancellationTokenSource(TimeSpan.FromMilliseconds(100))to verify theCancellationTokenis wired through to the native DISM callIProgress<DismProgress>to verify the parameter is accepted and callbacks fire for long-running operationsFiles added
CheckImageHealthAsyncTest.csCheckImageHealthAsyncAddPackageAsyncTest.csAddPackageAsyncAddCapabilityAsyncTest.csAddCapabilityAsyncCommitImageAsyncTest.csCommitImageAsyncDisableFeatureAsyncTest.csDisableFeatureAsyncEnableFeatureAsyncTest.csEnableFeatureAsync,EnableFeatureByPackageNameAsync,EnableFeatureByPackagePathAsyncMountImageAsyncTest.csMountImageAsync(by index + by name)RemoveCapabilityAsyncTest.csRemoveCapabilityAsyncRemovePackageAsyncTest.csRemovePackageByNameAsync,RemovePackageByPathAsyncRestoreImageHealthAsyncTest.csRestoreImageHealthAsyncSetEditionAsyncTest.csSetEditionAsync,SetEditionAndProductKeyAsyncUnmountImageAsyncTest.csUnmountImageAsyncSynchronousProgress.csIProgress<T>helper that invokes callbacks synchronously (avoidsProgress<T>'sSynchronizationContextposting)Conventions
DismTestBase/DismInstallWimTestBaseper existing patterns[Fact]attributesTestContext.Current.CancellationTokenrequirement (xUnit1051)CommitImageAsyncTestusesDismInstallWimTestBasefor a mounted offline session;MountImageAsyncTest/UnmountImageAsyncTesthandle mount cleanup inDispose()Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.