Skip to content

Fix AddParameter usage in tests#7305

Merged
eerhardt merged 1 commit intomicrosoft:mainfrom
eerhardt:FixParameterTests
Jan 28, 2025
Merged

Fix AddParameter usage in tests#7305
eerhardt merged 1 commit intomicrosoft:mainfrom
eerhardt:FixParameterTests

Conversation

@eerhardt
Copy link
Copy Markdown
Member

When adding the parameter first, and then setting the config, it accidently works because an exception is thrown at first and then the value is retrieved later when the config is set.

Fix this by ensuring the configuration is set first, before calling AddParameter.

For hosting tests for hosting integrations that aren't part of the core/base APIs, I changed the tests to be simple and just pass the constant value into AddParameter.

This is a follow-up to #7297.

When adding the parameter first, and then setting the config, it accidently works because an exception is thrown at first and then the value is retrieved later when the config is set.

Fix this by ensuring the configuration is set first, before calling AddParameter.

For hosting tests for hosting integrations that aren't part of the core/base APIs, I changed the tests to be simple and just pass the constant value into AddParameter.
Comment thread tests/Aspire.Hosting.Containers.Tests/WithDockerfileTests.cs
@eerhardt eerhardt enabled auto-merge (squash) January 28, 2025 19:17
@eerhardt eerhardt merged commit 6922a20 into microsoft:main Jan 28, 2025
@eerhardt eerhardt deleted the FixParameterTests branch January 29, 2025 21:06
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 1, 2025
@github-actions github-actions Bot added the area-integrations Issues pertaining to Aspire Integrations packages label Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants