Skip to content
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dotnet add package Testcontainers
```csharp title="Run the Hello World container"
// Create a new instance of a container.
var container = new ContainerBuilder()
// Set the image for the container to "testcontainers/helloworld:1.1.0".
.WithImage("testcontainers/helloworld:1.1.0")
// Set the image for the container to "testcontainers/helloworld:1.2.0".
.WithImage("testcontainers/helloworld:1.2.0")
// Bind port 8080 of the container to a random port on the host.
.WithPortBinding(8080, true)
// Wait until the HTTP endpoint of the container is available.
Expand All @@ -21,7 +21,7 @@ await container.StartAsync()
.ConfigureAwait(false);

// Create a new instance of HttpClient to send HTTP requests.
var httpClient = new HttpClient();
using httpClient = new HttpClient();

// Construct the request URI by specifying the scheme, hostname, assigned random host port, and the endpoint "uuid".
var requestUri = new UriBuilder(Uri.UriSchemeHttp, container.Hostname, container.GetMappedPublicPort(8080), "uuid").Uri;
Expand Down