Skip to content

Conversation

Copy link

Copilot AI commented Dec 18, 2025

A test in LocalStackProjectExtensionsTests used a manual ReferenceEquals() check with exception throwing, deviating from the TUnit assertion pattern used throughout the codebase.

Changed:

  • Replaced manual reference equality check with TUnit's .IsSameReferenceAs() assertion
  • Captured builder references outside the synchronous lambda to enable async assertion

Before:

var result = projectBuilder.WithReference(localStackBuilder: null);

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

After:

IResourceBuilder<ProjectResource>? capturedResult = null;
IResourceBuilder<ProjectResource>? capturedBuilder = null;

var (app, projectResource) = TestApplicationBuilder.CreateWithResource<ProjectResource>(/* ... */, builder =>
{
    var projectBuilder = builder.AddProject(/* ... */);
    capturedBuilder = projectBuilder;
    capturedResult = projectBuilder.WithReference(localStackBuilder: null);
});

await Assert.That(capturedResult).IsSameReferenceAs(capturedBuilder);

💡 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.

@github-actions
Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI changed the title [WIP] Fix issues raised in Aspire 13.1.0 and .NET 10 support PR Replace manual ReferenceEquals with TUnit IsSameReferenceAs assertion Dec 18, 2025
Copilot AI requested a review from Blind-Striker December 18, 2025 15:22
@Blind-Striker Blind-Striker deleted the copilot/sub-pr-20-again 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