Skip to content

Add NUnit migration tests for NestedContentMigratingConfig#905

Merged
KevinJump merged 3 commits intov17/nested-contentfrom
copilot/sub-pr-903-again
Mar 4, 2026
Merged

Add NUnit migration tests for NestedContentMigratingConfig#905
KevinJump merged 3 commits intov17/nested-contentfrom
copilot/sub-pr-903-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

NestedContentMigratingConfig (Nested Content → Block List migration) lacked test coverage. This PR adds NUnit migration tests consistent with the existing test patterns in the repo.

Tests added (NestedContentMigrationTests.cs)

  • Full migrationminItems, maxItems, multiple contentTypesvalidationLimit + blocks array
  • Validation limit edge cases — min only, max only, neither
  • Unknown alias skippingIContentTypeService.Get() returning null omits that block
  • Mixed aliases — only resolvable aliases produce BlockConfiguration entries
  • Empty contentTypes — results in null blocks (documents actual serialization pipeline behavior: JsonObjectConverter deserializes empty arrays as null when target type is object)

Bug fix

MediaSerializer.cs had a compile error introduced in a prior commit: parentId was declared inside a try block but referenced in the catch clause. Reverted to parent?.Id.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits March 4, 2026 14:42
Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com>
Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback from review on V17 nested content PR Add NUnit migration tests for NestedContentMigratingConfig Mar 4, 2026
@KevinJump KevinJump marked this pull request as ready for review March 4, 2026 14:57
@KevinJump KevinJump merged commit 0d21547 into v17/nested-content Mar 4, 2026
@KevinJump KevinJump deleted the copilot/sub-pr-903-again branch March 4, 2026 14:59
KevinJump added a commit that referenced this pull request Mar 4, 2026
* Add support for direct migration of nested content to blocklist. (as part of a sync).

* media item - logging parent fail

* Update uSync.Core/Serialization/Serializers/MediaSerializer.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update uSync.Core/Mapping/Mappers/NestedContentToBlockListHelper.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Use OfType instead of Cast when iterating nested content config array (#904)

* Initial plan

* Use OfType instead of Cast for resilience to non-object array entries

Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com>

* Add NUnit migration tests for NestedContentMigratingConfig (#905)

* Initial plan

* Fix MediaSerializer build error and plan nested content migration tests

Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com>

* Add NUnit migration tests for NestedContentMigratingConfig

Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com>
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.

2 participants