From 0fe69c8af6b720535bd4f1ae876a9129aee9f30c Mon Sep 17 00:00:00 2001 From: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:31:58 +0200 Subject: [PATCH] chore(AspireDashboard): Cover connection string provider --- .../AspireDashboardConnectionStringProvider.cs | 2 +- .../AspireDashboardContainerTest.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Testcontainers.AspireDashboard/AspireDashboardConnectionStringProvider.cs b/src/Testcontainers.AspireDashboard/AspireDashboardConnectionStringProvider.cs index db4f36757..9d7e27600 100644 --- a/src/Testcontainers.AspireDashboard/AspireDashboardConnectionStringProvider.cs +++ b/src/Testcontainers.AspireDashboard/AspireDashboardConnectionStringProvider.cs @@ -8,6 +8,6 @@ internal sealed class AspireDashboardConnectionStringProvider : ContainerConnect /// protected override string GetHostConnectionString() { - return Container.GetConnectionString(); + return Container.GetDashboardAddress(); } } \ No newline at end of file diff --git a/tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs b/tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs index 84133c6d2..3a771aca3 100644 --- a/tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs +++ b/tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs @@ -29,11 +29,12 @@ public async Task GetDashboardReturnsHttpStatusCodeOk() httpClient.BaseAddress = new Uri(_aspireDashboardContainer.GetDashboardAddress()); // When - using var response = await httpClient.GetAsync("/", TestContext.Current.CancellationToken) + using var httpResponse = await httpClient.GetAsync("/", TestContext.Current.CancellationToken) .ConfigureAwait(true); // Then - Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(HttpStatusCode.OK, httpResponse.StatusCode); + Assert.Equal(_aspireDashboardContainer.GetDashboardAddress(), _aspireDashboardContainer.GetConnectionString()); } [Fact]