PostgreSQL is a powerful, open-source relational database management system (RDBMS) used to store, manage, and retrieve structured data.
Add the following dependency to your project file:
NuGet
1
dotnetaddpackageTestcontainers.PostgreSql
You can start a PostgreSQL container instance from any .NET application. To create and start a container instance with the default configuration, use the module-specific builder as shown below:
The following example utilizes the xUnit.net module to reduce overhead by automatically managing the lifecycle of the dependent container instance. It creates and starts the container using the module-specific builder and injects it as a shared class fixture into the test class.