Skip to content

Use NUnit key constraints in DSCv3 settings tests#6371

Merged
florelis merged 1 commit into
microsoft:masterfrom
Trenly:trenly/issue-6369-nunit-settings-tests
Jul 15, 2026
Merged

Use NUnit key constraints in DSCv3 settings tests#6371
florelis merged 1 commit into
microsoft:masterfrom
Trenly:trenly/issue-6369-nunit-settings-tests

Conversation

@Trenly

@Trenly Trenly commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📖 Description

This PR updates Settings E2E tests to use NUnit built-in key constraints instead of boolean ContainsKey(...) checks.

Changed files:

  • src/AppInstallerCLIE2ETests/DSCv3AdminSettingsResourceCommand.cs
  • src/AppInstallerCLIE2ETests/DSCv3UserSettingsFileResourceCommand.cs

This was prepared with assistance from GitHub Copilot.

🔗 References

Resolves #6369

🔍 Validation

Not run in this session (user runs builds/tests).

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

* Replace ContainsKey boolean assertions with NUnit built-in key constraints in admin settings and user settings DSCv3 E2E tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@Trenly
Trenly marked this pull request as ready for review July 15, 2026 21:51
@Trenly
Trenly requested a review from a team as a code owner July 15, 2026 21:51
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@florelis

Copy link
Copy Markdown
Member

/azp run

@florelis
florelis requested a review from Copilot July 15, 2026 21:54
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates DSCv3 Settings E2E tests to use NUnit’s dictionary key constraints (e.g., Contains.Key(...) / Does.Not.ContainKey(...)) rather than asserting on boolean ContainsKey(...) results, improving assertion clarity and failure messages in the test suite.

Changes:

  • Replaced ContainsKey(...) == true/false assertions with Contains.Key(...) and Does.Not.ContainKey(...) constraints in admin settings DSCv3 tests.
  • Updated mock-property assertions in user settings file DSCv3 tests to use key constraints for both top-level and nested JSON objects.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/AppInstallerCLIE2ETests/DSCv3AdminSettingsResourceCommand.cs Swaps boolean ContainsKey asserts for NUnit key constraints across admin-settings resource get/test/set flows.
src/AppInstallerCLIE2ETests/DSCv3UserSettingsFileResourceCommand.cs Uses NUnit key constraints to validate presence of mock settings keys (including nested keys) in JSON settings.

@florelis
florelis merged commit c20cee9 into microsoft:master Jul 15, 2026
9 checks passed
@Trenly
Trenly deleted the trenly/issue-6369-nunit-settings-tests branch July 16, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use NUnit built-ins for Settings Tests

3 participants