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]