Skip to content

Commit

Permalink
Fix missing word in Testing with db (#3932)
Browse files Browse the repository at this point in the history
  • Loading branch information
TortillaZHawaii authored Jul 17, 2022
1 parent ae35816 commit ed9bec2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entity-framework/core/testing/testing-with-the-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Your test class now has a `Fixture` property which can be used by tests to creat

[!code-csharp[Main](../../../samples/core/Testing/TestingWithTheDatabase/BloggingControllerTest.cs?name=GetBlog&highlight=4)]

Finally, you may have noticed some locking in the fixture's creation logic above. If the fixture is only used in a single test class, it is guaranteed to be instantiated exactly once by xUnit; but it's common to use the same database fixture in multiple test classes. xUnit does provide [collection fixtures](https://xunit.net/docs/shared-context#collection-fixture), but that mechanism prevents your test classes from running in parallel, which is important for test performance. To safely manage this with an xUnit class fixture, we take a simple lock around database creation and seeding, and use a static flag to make sure we never to do it twice.
Finally, you may have noticed some locking in the fixture's creation logic above. If the fixture is only used in a single test class, it is guaranteed to be instantiated exactly once by xUnit; but it's common to use the same database fixture in multiple test classes. xUnit does provide [collection fixtures](https://xunit.net/docs/shared-context#collection-fixture), but that mechanism prevents your test classes from running in parallel, which is important for test performance. To safely manage this with an xUnit class fixture, we take a simple lock around database creation and seeding, and use a static flag to make sure we never have to do it twice.

## Tests which modify data

Expand Down

0 comments on commit ed9bec2

Please sign in to comment.