https://github.com/testcontainers/tc-guide-testing-aspnet-core
Getting started with Testcontainers in an ASP.NET Core web app
https://github.com/testcontainers/tc-guide-testing-aspnet-core
Last synced: 9 months ago
JSON representation
Getting started with Testcontainers in an ASP.NET Core web app
- Host: GitHub
- URL: https://github.com/testcontainers/tc-guide-testing-aspnet-core
- Owner: testcontainers
- License: mit
- Created: 2023-03-21T07:33:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-02T05:40:31.000Z (over 2 years ago)
- Last Synced: 2024-05-22T18:20:21.651Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 26.4 KB
- Stars: 5
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Testing an ASP.NET Core web app
This is sample code for [Testing an ASP.NET Core web app](https://testcontainers.com/guides/testing-an-aspnet-core-web-app) guide.
== 1. Setup Environment
Make sure you have .NET 7 and a [compatible Docker environment](https://www.testcontainers.org/supported_docker_environment/) installed.
For example:
[source,shell]
----
$ dotnet --list-sdks
7.0.104 [C:\Program Files\dotnet\sdk]
$ docker version
...
Server: Docker Desktop 4.12.0 (85629)
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
...
----
== 2. Setup Project
* Clone the repository
[source,shell]
----
git clone https://github.com/testcontainers/tc-guide-testing-aspnet-core.git
cd tc-guide-testing-aspnet-core
----
* Open the **tc-guide-testing-aspnet-core** project in your favorite IDE.
== 3. Run Tests
Run the command to run the tests.
[source,shell]
----
$ dotnet test ./RazorPagesProject.sln
----
The tests should pass.