Skip to content

Conversation

Copy link

Copilot AI commented Dec 18, 2025

Addressed PR review feedback for the TUnit migration: replaced manual reference equality checks with TUnit assertions, optimized JsonObject access patterns, and corrected analyzer suppressions.

Changes

  • TUnit Assertion Pattern (LocalStackProjectExtensionsTests.cs)

    • Replaced manual ReferenceEquals + exception throw with IsSameReferenceAs assertion
    • Refactored to capture builder references outside lambda to avoid async/await scope issues
  • JsonObject Access Optimization (EagerLoadedServicesTests.cs)

    • Changed from ContainsKey + indexer double lookup to single indexer access with null check
    • Pattern: var value = obj["key"]; if (value is not null) { ... }
  • Analyzer Suppression (LocalStackAssertions.cs)

    • Added comment explaining MA0015 suppression for property access pattern expectedLocalStack.Options
    • Analyzer flags this because it's not a direct parameter, requiring explicit suppression
  • Package Version (Directory.Packages.props)

    • Verified Aspire.Hosting.AWS 9.3.0 is correct (13.1.0 doesn't exist in NuGet)

Example

Before:

if (!ReferenceEquals(result, projectBuilder))
{
    throw new InvalidOperationException("Builder should be the same reference");
}

After:

await Assert.That(resultBuilder).IsSameReferenceAs(originalBuilder);

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update LocalStack Aspire for .NET 10 support and TUnit migration Fix TUnit assertion patterns and optimize JsonObject access Dec 18, 2025
Copilot AI requested a review from Blind-Striker December 18, 2025 15:26
@Blind-Striker Blind-Striker deleted the copilot/sub-pr-20 branch December 19, 2025 09:18
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