© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
6mo ago
•
16 replies
amirreza 🇮🇷🇵🇸
✅ Integration testing, database transaction
hi
i
'm learning about dotnet test tools
, using xunit
i have a web app
, i want to write some integration tests for it
my controllers change data
, so i want to rollback the changes after each test
.
since i can
't pass the db context to controllers
, i
'm thinking how i can achieve this
I
've found
TransactionScope
which i think will move everything to transaction automatically
, but i
'm not sure
will this do what i intend
?
TransactionScope Class (System.Transactions)
Makes a code block transactional
. This class cannot be inherited
.
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
✅ Integration testing
C
C# / help
16mo ago
Integration Testing
C
C# / help
4y ago
✅ Testing Guidance (Unit/Integration)
C
C# / help
4mo ago
❔ Which database for integration test using db transactions
C
C# / help
3y ago