Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add comprehensive PowerShell class tests for ConvertTo-Json#26769

Merged
daxian-dbw merged 3 commits intoPowerShell:masterPowerShell/PowerShell:masterfrom
yotsuda:add-convertto-json-class-testsyotsuda/PowerShell:add-convertto-json-class-testsCopy head branch name to clipboard
Feb 19, 2026
Merged

Add comprehensive PowerShell class tests for ConvertTo-Json#26769
daxian-dbw merged 3 commits intoPowerShell:masterPowerShell/PowerShell:masterfrom
yotsuda:add-convertto-json-class-testsyotsuda/PowerShell:add-convertto-json-class-testsCopy head branch name to clipboard

Conversation

@yotsuda
Copy link
Contributor

@yotsuda yotsuda commented Feb 10, 2026

PR Summary

Add comprehensive PowerShell class tests for ConvertTo-Json (Phase 5).

PR Context

This is a follow-up to #26743. Per @iSazonov's suggestion in #26639, comprehensive tests are being submitted as separate PRs for each phase.

PR Checklist

Tests Added

The following PowerShell class tests are added to ConvertTo-Json.Tests.ps1.
Per review feedback, all property types are consolidated into a single SimpleClass (primitive, BigInt, Guid, IPAddress, array and ordered dictionary with compound nested elements, hidden, and ETS properties including nested member ETS). All assertions use BeExactly.

Context Tests Description
PowerShell class serialization 2 comprehensive SimpleClass with all property types + ETS, default values
Nested PowerShell class 2 deeply nested (3-level), null child
PowerShell class inheritance 2 derived class, multi-level inheritance
Mixed PSCustomObject and PowerShell class 1 mixed type array (class + PSCustomObject)

Total: 7 new tests

Copilot AI review requested due to automatic review settings February 10, 2026 08:07
@yotsuda yotsuda requested a review from a team as a code owner February 10, 2026 08:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Phase 5 “comprehensive” coverage for ConvertTo-Json focused specifically on PowerShell class instances, extending the existing phased test suite for ConvertTo-Json behavior.

Changes:

  • Adds basic PowerShell class serialization tests (simple properties, constructors, default values, method exclusion, hidden properties).
  • Adds nested-class and inheritance serialization coverage.
  • Adds coverage for ETS (extended) properties and mixed arrays containing both class instances and PSCustomObject.

@iSazonov iSazonov added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Feb 10, 2026
Replace multiple small classes with a single SimpleClass covering all property
types (primitive, BigInt, Guid, IPAddress, array, dictionary, hidden, ETS).
Remove constructor, method, and separate ETS tests. 14 tests -> 7 tests.
@iSazonov iSazonov self-assigned this Feb 10, 2026
Change all Phase 5 assertions from Match to BeExactly. Use OrderedDictionary
for deterministic key order. Add ETS NoteProperty to nested IPVal member.
@microsoft-github-policy-service microsoft-github-policy-service bot added the Review - Needed The PR is being reviewed label Feb 18, 2026
@microsoft-github-policy-service
Copy link
Contributor

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@iSazonov iSazonov added the Approved-LowRisk Indicate a PR has been approved and can be merged after a quick review of another maintainer. label Feb 19, 2026
@daxian-dbw daxian-dbw merged commit 2f08eb4 into PowerShell:master Feb 19, 2026
39 checks passed
@daxian-dbw daxian-dbw removed the Review - Needed The PR is being reviewed label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved-LowRisk Indicate a PR has been approved and can be merged after a quick review of another maintainer. CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments

Close sidebar
Morty Proxy This is a proxified and sanitized view of the page, visit original site.