Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor exception handling in environment variable tests to use Miss…
…ingParameterValueException
  • Loading branch information
davidfowl committed Jul 3, 2025
commit a44dfae2cd738e2bcf50bc70be4d27e6e37dbfcc
2 changes: 1 addition & 1 deletion tests/Aspire.Hosting.Tests/WithEnvironmentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public async Task EnvironmentCallbackThrowsWhenParameterValueMissingInDcpMode()
var projectA = builder.AddProject<ProjectA>("projectA")
.WithEnvironment("MY_PARAMETER", parameter);

var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(
var exception = await Assert.ThrowsAsync<MissingParameterValueException>(async () => await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(
projectA.Resource,
DistributedApplicationOperation.Run,
TestServiceProvider.Instance
Expand Down
2 changes: 1 addition & 1 deletion tests/Aspire.Hosting.Tests/WithReferenceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public async Task ParameterAsConnectionStringResourceThrowsWhenConnectionStringS
.WithReference(missingResource);

// Call environment variable callbacks.
var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () =>
var exception = await Assert.ThrowsAsync<MissingParameterValueException>(async () =>
{
var config = await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(projectB.Resource, DistributedApplicationOperation.Run, TestServiceProvider.Instance);
}).DefaultTimeout();
Expand Down
Loading