© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#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.
TransactionScope Class (System.Transactions)
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Integration testing
C#CC# / help
16mo ago
Integration Testing
C#CC# / help
4y ago
✅ Testing Guidance (Unit/Integration)
C#CC# / help
4mo ago
❔ Which database for integration test using db transactions
C#CC# / help
3y ago