Skip to content

Commit 123ee50

Browse files
Copilotroji
andcommitted
Fix GitHub capitalization in choosing-a-testing-strategy.md
Co-authored-by: roji <1862641+roji@users.noreply.github.com>
1 parent 5f3c0cf commit 123ee50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entity-framework/core/testing/choosing-a-testing-strategy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ However, tests which pass against a test double don't guarantee that your progra
2121

2222
Because of the above difficulties with testing against a real database, developers are frequently urged to use test doubles first, and have a robust test suite which they can run frequently on their machines; tests involving the database, in contrast, are supposed to be executed much less frequently, and in many cases also provide far less coverage. We recommend giving more thought to the latter, and suggest that databases may actually be far less affected by the above problems than people tend to think:
2323

24-
1. Most databases can nowadays be easily installed on the developer's machine. Container-based technologies such as Docker can make this very easy, and libraries like [Testcontainers](https://testcontainers.com/modules/dotnet/) can help automate the lifecycle of containerized databases in your tests. Technologies such as [Github Workspaces](https://docs.github.com/en/codespaces/overview) and [Dev Container](https://code.visualstudio.com/docs/remote/create-dev-container) set up your entire development environment for you (including the database). When using SQL Server, it's also possible to test against [LocalDB](/sql/database-engine/configure-windows/sql-server-express-localdb) on Windows, or easily set up a Docker image on Linux.
24+
1. Most databases can nowadays be easily installed on the developer's machine. Container-based technologies such as Docker can make this very easy, and libraries like [Testcontainers](https://testcontainers.com/modules/dotnet/) can help automate the lifecycle of containerized databases in your tests. Technologies such as [GitHub Workspaces](https://docs.github.com/en/codespaces/overview) and [Dev Container](https://code.visualstudio.com/docs/remote/create-dev-container) set up your entire development environment for you (including the database). When using SQL Server, it's also possible to test against [LocalDB](/sql/database-engine/configure-windows/sql-server-express-localdb) on Windows, or easily set up a Docker image on Linux.
2525
2. Testing against a local database - with a reasonable test dataset - is usually extremely fast: communication is completely local, and test data is typically buffered in memory on the database side. EF Core itself contains over 30,000 tests against SQL Server alone; these complete reliably in a few minutes, execute in CI on every single commit, and are very frequently executed by developers locally. Some developers turn to an in-memory database (a "fake") in the belief that this is needed for speed - this is almost never actually the case.
2626
3. Isolation is indeed a hurdle when running tests against a real database, as tests may modify data and interfere with one another. However, there are various techniques to provide isolation in database testing scenarios; we concentrate on these in [Testing against your production database system](xref:core/testing/testing-with-the-database)).
2727

0 commit comments

Comments
 (0)