skoll9233
skoll9233
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Totally agree with you, but that if you have a system at scale. What I do Is a simple CRUD where adding an entity to the db is the core usecase 🙂
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Well, honestly speaking I didn't think about how all of this works under the hood and how much control I have over it. Thank you again for pointing this out to me. The reason why I want to test the core with an actual database is that I want to have guarantees that a specific build works with that specific database.
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Well, thank you very much anyway! I was struggling with this issue the whole day, and now I have an understanding of what went wrong and that I have some misconceptions on my side
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
That's a little bit too expensive
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Well, I guess then I will be forced to execute tests inside separated docker environments...
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Will I be able to use this same approach with the real database?
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
But I did not understand you when you said "per-test" vs "per class fixture"
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Oh, so basically I can just generate the unique database for each separated test? That makes sense!
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Well, I have an idea. I may try to turn db context into transient rather than scoped. But I feel like this is a fools path as the result is unclear for me
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Yeah, I saw that one. I just needed something to catch up quickly with asp.net and choose the in memory one
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Yes, but not only a database but a whole context with it: MediatR, FluentValidators, and other services that are registered inside the Program.cs
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
I have a few use cases in my application and I want to test them with the actual database rather than mocked one. As I said, later I will switch in memory db adapter to pgsql.
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Microsoft.EntityFrameworkCore.InMemory
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
later on I will add pgsql and testcontainers
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
Yes, but what I am trying to achieve is subcutaneous testing, so I want to test the core of my application as close to the real-world scenario as possible
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
So, the problem here definitely with the shared db context
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
(migrating from java/spring btw)
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
I am sorry, what I do may sound stupid but I am really new to the asp net. Basically I made this project 4 days ago
53 replies
CC#
Created by skoll9233 on 3/10/2023 in #help
❔ Help needed to clear database with EF between XUnit tests
53 replies