diff --git a/Using-WireMock.Net.Testcontainers.md b/Using-WireMock.Net.Testcontainers.md index 410d021..2c1c99f 100644 --- a/Using-WireMock.Net.Testcontainers.md +++ b/Using-WireMock.Net.Testcontainers.md @@ -26,5 +26,18 @@ The following builder methods are available for the `WireMockContainerBuilder`: | `WithWatchStaticMappings` | `.WithWatchStaticMappings(true)` | Watch the static mapping files + folder for changes when running. | `WithAdminUserNameAndPassword` | `.WithAdminUserNameAndPassword("x", "y")` | Set the admin username. and password for the container (basic authentication). +### Create a Admin Client +Use the following code to get a [RestEase Admin Client](https://github.com/WireMock-Net/WireMock.Net/wiki/Admin-API-Reference#client-api) for this running container instance. +``` c# +var restEaseApiClient = container.CreateWireMockAdminClient(); +``` + +### Create a HTTP Client +Use the following code to get a HTTP Client for this running container instance to call WireMock.Net +``` c# +var client = container.CreateClient(); +var result = await client.GetStringAsync("/test123"); +``` + ## Usage in Unit Test Follow the tutorial [here](https://github.com/testcontainers/testcontainers-dotnet/blob/develop/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastTest.cs) and make sure to use WireMock.Net container instead of the container used in that example. \ No newline at end of file