Skip to content

Commit 43e21fe

Browse files
Copilotdavidfowl
andcommitted
Fix Azure tests to use new DeploymentStateSection constructor without IDisposable
Co-authored-by: davidfowl <[email protected]>
1 parent efe2f6f commit 43e21fe

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

tests/Aspire.Hosting.Azure.Tests/AzureDeployerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ private sealed class NoOpDeploymentStateManager : IDeploymentStateManager
905905
public string? StateFilePath => null;
906906

907907
public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
908-
=> Task.FromResult(new DeploymentStateSection(sectionName, [], 0, null));
908+
=> Task.FromResult(new DeploymentStateSection(sectionName, [], 0));
909909

910910
public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) => Task.CompletedTask;
911911
}

tests/Aspire.Hosting.Azure.Tests/ProvisioningContextTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ public async Task TestUserSecretsManager_CanSaveAndLoadSection()
199199
var manager = ProvisioningTestHelpers.CreateUserSecretsManager();
200200

201201
// Act
202-
using var azureSection = await manager.AcquireSectionAsync("Azure");
202+
var azureSection = await manager.AcquireSectionAsync("Azure");
203203
azureSection.Data["SubscriptionId"] = "test-id";
204204
await manager.SaveSectionAsync(azureSection);
205205

206-
using var loadedSection = await manager.AcquireSectionAsync("Azure");
206+
var loadedSection = await manager.AcquireSectionAsync("Azure");
207207

208208
// Assert
209209
Assert.NotNull(loadedSection);

tests/Aspire.Hosting.Azure.Tests/ProvisioningTestHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, Canc
602602
var sectionData = _state.TryGetPropertyValue(sectionName, out var node) && node is JsonObject obj
603603
? obj
604604
: new JsonObject();
605-
return Task.FromResult(new DeploymentStateSection(sectionName, sectionData, 0, null));
605+
return Task.FromResult(new DeploymentStateSection(sectionName, sectionData, 0));
606606
}
607607

608608
public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default)

0 commit comments

Comments
 (0)