Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax committed Oct 20, 2023
1 parent fd25ef5 commit 2ead8be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Whenever I start or join a new project first thing I want is good tests. These t
- Docker

## Notable features:
- No manual setup required, `dotnet test` is all you need to run. For instance when testing a app that requires a database the test code itself makes sure the database is running using [TestContainers](https://dotnet.testcontainers.org/).
- No manual setup required, `dotnet test` is all you need to run. This not only makes it easy for developers to run the tests but also simplifies the CI as you can see in the [github workflow file](.github/workflows/dotnet.yml). This is made possible with the magic of [TestContainers](https://dotnet.testcontainers.org/) and some custom code.
- Databases are pooled and cleaned between runs with [Respawn](https://github.com/jbogard/Respawn). This way migrations only have to be run once which saves alot of time.
- Tests can run in parallel.

## How to use
I decided not to turn this into a nuget package for now. Depending on if you are using nunit or xunit copy the code that you need to your project. For instance if you are using PostgreSql then copy the code from [AwesomeApiTest](AwesomeApiTest) and [AwesomeApiTest.PostgreSql](AwesomeApiTest.PostgreSql) to your test project. For examples on how to setup nunit or xunit see the [Examples](Examples).
I decided not to turn this into a nuget package for now. Depending on if you are using nunit or xunit copy the code that you need to your project. For instance if you are using PostgreSql then copy the code from [TestExamplesDotnet](TestExamplesDotnet) and [TestExamplesDotnet.PostgreSql](TestExamplesDotnet.PostgreSql) to your test project. For examples on how to setup nunit or xunit see the [Examples](Examples).

I do suggest you flatten the code that you need into a single project to keep things simpler.

## Examples
Some examples can be found in [Examples](Examples). For instance for postgresql you can find examples for [NUnit](Examples/Api/PostgreSql/Api.PostgreSql.Nunit) and [xUnit](Examples/Api/PostgreSql/Api.PostgreSql.Xunit). There's also a browser test example using [Playwright](https://github.com/Barsonax/TestExamplesDotnet/tree/master/Examples/Razor/Razor.Playwright).
Some examples can be found in [Examples](Examples). For instance for postgresql you can find examples for [NUnit](Examples/Api/PostgreSql/Api.PostgreSql.Nunit) and [xUnit](Examples/Api/PostgreSql/Api.PostgreSql.Xunit). There's also a browser test example using [Playwright](Examples/Razor/Razor.Playwright).

0 comments on commit 2ead8be

Please sign in to comment.