Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document usage of change tracker clearing before calling test #48

Closed
ArwynFr opened this issue Jun 21, 2024 · 0 comments · Fixed by #50
Closed

Document usage of change tracker clearing before calling test #48

ArwynFr opened this issue Jun 21, 2024 · 0 comments · Fixed by #50
Labels
type: 📝 documentation Improvements or additions to documentation

Comments

@ArwynFr
Copy link
Owner

ArwynFr commented Jun 21, 2024

Add these informations to the usage documentation:

The library uses a singleton instance of the DbContext. Any calls to the DbContext during the arrange phase (either directly or through the HttpClient) might clogger the Change Tracker with existing entities. These tracked entities may cause attaching objects to fail within the context of the test, whereas it would have worked with a clean scoped DbContext instance. Is such case, the test writer should call Database.ChangeTracker.Clean() between arrange and acting calls.

@ArwynFr ArwynFr added the type: 📝 documentation Improvements or additions to documentation label Jun 21, 2024
ArwynFr added a commit that referenced this issue Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: 📝 documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant